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 d015b5a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 17 deletions.
36 changes: 21 additions & 15 deletions .github/workflows/install-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,32 @@ 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"
docker run --rm \
-v $SSH_AUTH_SOCK:/ssh-agent \
-v ~/.ssh/known_hosts:/root/.ssh/known_hosts \
-e SSH_AUTH_SOCK=/ssh-agent \
-v ${{ github.workspace }}:/workspace \
manjarolinux/base:latest \
/bin/bash -c "
GREEN='\033[0;32'; NC='\033[om'
echo -e '${GREEN}Install openssh and git${NC}' \
cat /root/.ssh/id_rsa \
pacman -Sy --noconfirm openssh git && \
echo -e '${GREEN}Add ssh keys${NC}' \
ssh-add -l \
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 d015b5a

Please sign in to comment.