Skip to content

Commit

Permalink
User docker command directly
Browse files Browse the repository at this point in the history
  • Loading branch information
erichlf committed May 18, 2024
1 parent 21b2c9e commit d1b7ddb
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 17 deletions.
35 changes: 20 additions & 15 deletions .github/workflows/install-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,31 @@ on:
- main
jobs:
install:
container:
image: archlinux:latest
options: --user=root --entrypoint=/bin/bash
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
SSH_AUTH_SOCK: ${{ secrets.SSH_AUTH_SOCK }}
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ${{ github.workspace }}:/workspace
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup ssh
uses: PhutureCorp/container-ssh-agent@v0.0.1
uses: webfactory/ssh-agent@v0.9.0
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: install
- name: Install
run: |
pacman -Sy --noconfirm sudo openssh git
git config --global --add safe.directory /workspace
cd /workspace
./install.sh"
# Update known hosts within the container (recommended)
echo -e "${GREEN}Update known hosts${NC}"
ssh-keyscan -H github.com >> ~/.ssh/known_hosts
docker run --rm \
-v ${{ github.workspace }}:/workspace \
-e SSH_AUTH_SOCK=/ssh-agent (if using SSH key) # Optional
manjarolinux/base:latest \
/bin/bash -c "
GREEN='\033[0;32'; NC='\033[om'
echo -e '${GREEN}Install openssh and git${NC}'
pacman -Sy --noconfirm openssh git && \
echo -e '${GREEN}Add /workspace to trusted repos${NC}'
git config --global --add safe.directory /workspace && \
echo -e '${GREEN}Start install${NC}'
cd /workspace && \
./install.sh
"
4 changes: 2 additions & 2 deletions scripts/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,13 @@ function pac_update(){
}

function pac_install(){
yes | sudo pacman -S --needed $@
sudo pacman -S --needed --noconfirm $@

return 0
}

function yay_install(){
yes | yay -S --needed $@ --mflags "--nocheck"
yay -S --needed --noconfirm $@ --mflags "--nocheck"

return 0
}
Expand Down

0 comments on commit d1b7ddb

Please sign in to comment.