From f9f3a82f2371fcd403db33e3652779b93d57457d Mon Sep 17 00:00:00 2001 From: June Date: Sat, 26 Jul 2025 16:00:10 +0200 Subject: [PATCH 1/3] ci: factor out "Pipeline info" step into separate job for nicer org. --- .forgejo/workflows/deploy.yaml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.forgejo/workflows/deploy.yaml b/.forgejo/workflows/deploy.yaml index 65befb1..f0bfb13 100644 --- a/.forgejo/workflows/deploy.yaml +++ b/.forgejo/workflows/deploy.yaml @@ -10,15 +10,20 @@ env: TZ: Europe/Berlin jobs: - build: + pipeline-info: runs-on: docker container: - image: hugomods/hugo:exts-0.148.1 + image: code.forgejo.org/oci/node:22-bookworm steps: - name: Pipeline info run: | echo "Run triggered by ${{ github.event_name }} (${{ github.event.action }}) on ref ${{ github.ref_name }}" + build: + runs-on: docker + container: + image: hugomods/hugo:exts-0.148.1 + steps: - name: Install packages run: | apk update From cb089a6d0590a0578699d2259d2d38436749ec36 Mon Sep 17 00:00:00 2001 From: June Date: Sat, 26 Jul 2025 16:11:02 +0200 Subject: [PATCH 2/3] ci: make step conditions more structured Either have a step always be executed, be executed for prod or be executed for a PR (staging) and use the same conditions for each of these cases. --- .forgejo/workflows/deploy.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.forgejo/workflows/deploy.yaml b/.forgejo/workflows/deploy.yaml index f0bfb13..a2f1716 100644 --- a/.forgejo/workflows/deploy.yaml +++ b/.forgejo/workflows/deploy.yaml @@ -39,12 +39,13 @@ jobs: fetch-depth: 0 # pull full history for page lastmod by git commit date - name: Build website - prod + if: (github.event_name == 'push' || github.event_name == 'schedule') && github.ref_name == 'main' run: | ./fetch-calendar.sh hugo - name: Build website - staging - if: github.ref_name != 'main' + if: github.event_name == 'pull_request' run: | sed -i "s#baseURL = 'https://hamburg.ccc.de/'#baseURL = 'https://staging.hamburg.ccc.de/pr${{ github.event.pull_request.number }}/'#" hugo.toml sed -i "s#index = true#index = false#" hugo.toml @@ -53,7 +54,6 @@ jobs: hugo --buildFuture - name: Deploy - Prepare keys - if: github.event_name == 'push' || github.event_name == 'pull_request' || github.event_name == 'schedule' run: | echo "${{ secrets.SSH_DEPLOY_KEY }}" > deploykey.priv chmod 400 deploykey.priv From c40ba3de32c0e5369d8153d4b6ad956ab06a33cc Mon Sep 17 00:00:00 2001 From: June Date: Sat, 26 Jul 2025 16:11:02 +0200 Subject: [PATCH 3/3] ci: make step conditions more structured Either have a step always be executed, be executed for prod or be executed for a PR (staging) and use the same conditions for each of these cases. --- .forgejo/workflows/deploy.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.forgejo/workflows/deploy.yaml b/.forgejo/workflows/deploy.yaml index 65befb1..4f749f5 100644 --- a/.forgejo/workflows/deploy.yaml +++ b/.forgejo/workflows/deploy.yaml @@ -34,12 +34,13 @@ jobs: fetch-depth: 0 # pull full history for page lastmod by git commit date - name: Build website - prod + if: (github.event_name == 'push' || github.event_name == 'schedule') && github.ref_name == 'main' run: | ./fetch-calendar.sh hugo - name: Build website - staging - if: github.ref_name != 'main' + if: github.event_name == 'pull_request' run: | sed -i "s#baseURL = 'https://hamburg.ccc.de/'#baseURL = 'https://staging.hamburg.ccc.de/pr${{ github.event.pull_request.number }}/'#" hugo.toml sed -i "s#index = true#index = false#" hugo.toml @@ -48,7 +49,6 @@ jobs: hugo --buildFuture - name: Deploy - Prepare keys - if: github.event_name == 'push' || github.event_name == 'pull_request' || github.event_name == 'schedule' run: | echo "${{ secrets.SSH_DEPLOY_KEY }}" > deploykey.priv chmod 400 deploykey.priv