From c1789d25c8bdf2846819f6f7c70f6e57fd11d51d Mon Sep 17 00:00:00 2001 From: Gerasimos Chourdakis Date: Tue, 31 Mar 2026 14:08:27 +0200 Subject: [PATCH 1/5] Extend the CI build workflow to deploy a preview --- .github/workflows/build.yml | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 49beaa1..2fb6207 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,7 +1,14 @@ -name: Build the website +name: Build and deploy a preview website on: pull_request: + types: + - opened + - reopened + - synchronize + - closed + +concurrency: preview-${{ github.ref }} jobs: build-website: @@ -18,4 +25,15 @@ jobs: - name: Upload artifact uses: actions/upload-pages-artifact@v4 with: - path: "./built-website" \ No newline at end of file + path: "./built-website" + deploy-preview: + runs-on: ubuntu-latest + steps: + - name: Deploy preview + uses: rossjrw/pr-preview-action@v1 + with: + source-dir: ./built-website/ + preview-branch: master + umbrella-dir: chapter/pr-preview + pages-base-path: chapter + qr-code: true \ No newline at end of file From d06d6db81b408982e869930ce11b40f88208db0a Mon Sep 17 00:00:00 2001 From: Gerasimos Chourdakis Date: Tue, 31 Mar 2026 14:17:05 +0200 Subject: [PATCH 2/5] Add a job dependency --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2fb6207..46777b7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,6 +27,7 @@ jobs: with: path: "./built-website" deploy-preview: + needs: build-website runs-on: ubuntu-latest steps: - name: Deploy preview From 00717c9ac60ccd9e881a2cee3732b5306b3e6cc3 Mon Sep 17 00:00:00 2001 From: Gerasimos Chourdakis Date: Tue, 31 Mar 2026 14:19:52 +0200 Subject: [PATCH 3/5] Add a step to download artifact --- .github/workflows/build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 46777b7..1ebf081 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,6 +30,9 @@ jobs: needs: build-website runs-on: ubuntu-latest steps: + - uses: actions/download-artifact@v8 + with: + name: github-pages - name: Deploy preview uses: rossjrw/pr-preview-action@v1 with: From ad71273c12be34d679392de36f9d79c301b36021 Mon Sep 17 00:00:00 2001 From: Gerasimos Chourdakis Date: Tue, 31 Mar 2026 14:27:22 +0200 Subject: [PATCH 4/5] Merge the two jobs --- .github/workflows/build.yml | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1ebf081..57554d3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,7 +11,7 @@ on: concurrency: preview-${{ github.ref }} jobs: - build-website: + build-and-deploy-website: runs-on: ubuntu-latest steps: - name: Checkout @@ -26,17 +26,10 @@ jobs: uses: actions/upload-pages-artifact@v4 with: path: "./built-website" - deploy-preview: - needs: build-website - runs-on: ubuntu-latest - steps: - - uses: actions/download-artifact@v8 - with: - name: github-pages - name: Deploy preview uses: rossjrw/pr-preview-action@v1 with: - source-dir: ./built-website/ + source-dir: ./built-website preview-branch: master umbrella-dir: chapter/pr-preview pages-base-path: chapter From 3d8648da549c9cde9af2d0f805784150914d022a Mon Sep 17 00:00:00 2001 From: Gerasimos Chourdakis Date: Tue, 31 Mar 2026 14:40:34 +0200 Subject: [PATCH 5/5] Switch deploy branch to gh-pages --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 57554d3..eda68cc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,7 +30,7 @@ jobs: uses: rossjrw/pr-preview-action@v1 with: source-dir: ./built-website - preview-branch: master + preview-branch: gh-pages umbrella-dir: chapter/pr-preview pages-base-path: chapter qr-code: true \ No newline at end of file