From 86e3c7be49e53e71bca3469b6f1966dfe2da103f Mon Sep 17 00:00:00 2001 From: SessionHero01 <180888785+SessionHero01@users.noreply.github.com> Date: Wed, 25 Jun 2025 16:55:31 +1000 Subject: [PATCH 1/4] Use github action to build and deploy pages --- .github/workflows/build-and-deploy-pages.yml | 29 ++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/build-and-deploy-pages.yml diff --git a/.github/workflows/build-and-deploy-pages.yml b/.github/workflows/build-and-deploy-pages.yml new file mode 100644 index 0000000..df51fa0 --- /dev/null +++ b/.github/workflows/build-and-deploy-pages.yml @@ -0,0 +1,29 @@ +name: Jekyll site CI + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + build: + runs-on: ubuntu-latest + + permissions: + pages: write # to deploy to Pages + id-token: write # to verify the deployment originates from an appropriate source + + steps: + - uses: actions/checkout@v4 + - name: Build the site in the jekyll/builder container + run: | + docker run \ + -v ${{ github.workspace }}:/srv/jekyll -v ${{ github.workspace }}/_site:/srv/jekyll/_site \ + jekyll/builder:latest /bin/bash -c "chmod -R 777 /srv/jekyll && jekyll build --future" + - uses: actions/deploy-pages@v4 + if: github.event_name == 'push' + with: + # GitHub token + token: ${{ github.token }} + From e83b4d50caf20b253e649438d1b59d75df3af5b0 Mon Sep 17 00:00:00 2001 From: SessionHero01 <180888785+SessionHero01@users.noreply.github.com> Date: Wed, 25 Jun 2025 17:04:22 +1000 Subject: [PATCH 2/4] Update build-and-deploy-pages.yml --- .github/workflows/build-and-deploy-pages.yml | 39 +++++++++++++------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build-and-deploy-pages.yml b/.github/workflows/build-and-deploy-pages.yml index df51fa0..4dc4347 100644 --- a/.github/workflows/build-and-deploy-pages.yml +++ b/.github/workflows/build-and-deploy-pages.yml @@ -7,23 +7,36 @@ on: branches: [ "master" ] jobs: + # Build job build: + # Specify runner + build & upload the static files as an artifact runs-on: ubuntu-latest + steps: + - name: Build static files + id: build + run: | + docker run \ + -v ${{ github.workspace }}:/srv/jekyll -v ${{ github.workspace }}/_site:/srv/jekyll/_site \ + jekyll/builder:latest /bin/bash -c "chmod -R 777 /srv/jekyll && jekyll build --future" + + - name: Upload static files as artifact + id: deployment + uses: actions/upload-pages-artifact@v3 + with: + path: _site/ + # Deployment job + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} permissions: pages: write # to deploy to Pages id-token: write # to verify the deployment originates from an appropriate source - + runs-on: ubuntu-latest + if: github.event_name == 'push' + needs: build steps: - - uses: actions/checkout@v4 - - name: Build the site in the jekyll/builder container - run: | - docker run \ - -v ${{ github.workspace }}:/srv/jekyll -v ${{ github.workspace }}/_site:/srv/jekyll/_site \ - jekyll/builder:latest /bin/bash -c "chmod -R 777 /srv/jekyll && jekyll build --future" - - uses: actions/deploy-pages@v4 - if: github.event_name == 'push' - with: - # GitHub token - token: ${{ github.token }} - + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 From ed3c1aa5571b1a6f6da891f939cddebf4f5b6da9 Mon Sep 17 00:00:00 2001 From: SessionHero01 <180888785+SessionHero01@users.noreply.github.com> Date: Wed, 25 Jun 2025 17:06:37 +1000 Subject: [PATCH 3/4] Update build-and-deploy-pages.yml --- .github/workflows/build-and-deploy-pages.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-and-deploy-pages.yml b/.github/workflows/build-and-deploy-pages.yml index 4dc4347..d3a082f 100644 --- a/.github/workflows/build-and-deploy-pages.yml +++ b/.github/workflows/build-and-deploy-pages.yml @@ -1,4 +1,4 @@ -name: Jekyll site CI +name: Build and deploy pages on: push: @@ -12,6 +12,9 @@ jobs: # Specify runner + build & upload the static files as an artifact runs-on: ubuntu-latest steps: + - uses: actions/checkout@v4 + with: + lfs: true - name: Build static files id: build run: | From 1cb9b3dc7d1f550052474cb2b2250aef91a314c2 Mon Sep 17 00:00:00 2001 From: SessionHero01 <180888785+SessionHero01@users.noreply.github.com> Date: Wed, 25 Jun 2025 17:09:46 +1000 Subject: [PATCH 4/4] Update build-and-deploy-pages.yml --- .github/workflows/build-and-deploy-pages.yml | 51 +++++++++++--------- 1 file changed, 29 insertions(+), 22 deletions(-) diff --git a/.github/workflows/build-and-deploy-pages.yml b/.github/workflows/build-and-deploy-pages.yml index d3a082f..ad3fab0 100644 --- a/.github/workflows/build-and-deploy-pages.yml +++ b/.github/workflows/build-and-deploy-pages.yml @@ -1,43 +1,50 @@ -name: Build and deploy pages +name: Deploy Jekyll with GitHub Pages dependencies preinstalled on: + # Runs on pushes targeting the default branch push: - branches: [ "master" ] - pull_request: - branches: [ "master" ] + branches: ["master"] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false jobs: # Build job build: - # Specify runner + build & upload the static files as an artifact runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - with: + - name: Checkout + uses: actions/checkout@v4 + with: lfs: true - - name: Build static files - id: build - run: | - docker run \ - -v ${{ github.workspace }}:/srv/jekyll -v ${{ github.workspace }}/_site:/srv/jekyll/_site \ - jekyll/builder:latest /bin/bash -c "chmod -R 777 /srv/jekyll && jekyll build --future" - - - name: Upload static files as artifact - id: deployment - uses: actions/upload-pages-artifact@v3 + - name: Setup Pages + uses: actions/configure-pages@v5 + - name: Build with Jekyll + uses: actions/jekyll-build-pages@v1 with: - path: _site/ + source: ./ + destination: ./_site + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 # Deployment job deploy: environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} - permissions: - pages: write # to deploy to Pages - id-token: write # to verify the deployment originates from an appropriate source runs-on: ubuntu-latest - if: github.event_name == 'push' needs: build steps: - name: Deploy to GitHub Pages