From 86c599b33e7b1990be55f88afb8d27e48e81c769 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Jab=C5=AFrek?= Date: Wed, 9 Oct 2024 17:10:25 +0200 Subject: [PATCH] ci: fix access to enginiro repos --- .github/workflows/pages.yml | 13 ++++++------- build.sh | 4 ++++ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 5cbd5e0..b6a5cca 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -6,18 +6,17 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: webfactory/ssh-agent@v0.7.0 - with: - ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} + - uses: actions/checkout@v4 - uses: shivammathur/setup-php@v2 with: - php-version: '7.4' - - uses: actions/setup-node@v3 + php-version: '8.1' + - uses: actions/setup-node@v4 with: - node-version: 18 + node-version: 22 - run: npm install - run: ./build.sh + env: + GH_ENGINIRO_TOKEN: ${{ secrets.GH_ENGINIRO_TOKEN }} - run: touch build/site/.nojekyll - uses: actions/upload-pages-artifact@v1 with: diff --git a/build.sh b/build.sh index 124bf14..49e84bc 100755 --- a/build.sh +++ b/build.sh @@ -26,6 +26,10 @@ while read -r repository; do git pull cd ../ else + if [ "$GH_ENGINIRO_TOKEN" != "" ]; then + repository="$(echo "$repository" | sed "s%git@github.com:enginiro/%https://enginiro:$GH_ENGINIRO_TOKEN@github.com/enginiro/%")" + fi + git clone --depth 1 "$repository" --branch "main" --single-branch fi