diff --git a/.github/workflows/install-ci.yml b/.github/workflows/install-ci.yml index 3372cb4..ace1ba1 100644 --- a/.github/workflows/install-ci.yml +++ b/.github/workflows/install-ci.yml @@ -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" + # Update known hosts within the container (recommended) + echo -e "${GREEN}Update known hosts${NC}" + echo "$SSH_PRIVATE_KEY" + ssh-keyscan -H github.com >> ~/.ssh/known_hosts + + docker run --rm \ + -v ${{ github.workspace }}:/workspace \ + -e SSH_AUTH_SOCK=/ssh-agent \ + 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 + " diff --git a/scripts/utils.sh b/scripts/utils.sh index 7cd817a..3047312 100644 --- a/scripts/utils.sh +++ b/scripts/utils.sh @@ -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 }