From 78a878692ea3e6479b0c96307339e79fc24c2d3f Mon Sep 17 00:00:00 2001 From: Thomas Adam Date: Wed, 10 Apr 2024 17:09:03 +0100 Subject: [PATCH] CI: add custom build container This moves the jekyll build and gh-pages deployment stage into a customer Github actions file. Doing this will allow for us to use any custom jekyll plugins which can't be used with Github's native build system for GH pages, and therefore we only need to upload the result of the site generation. --- .github/workflows/jekyll-docker.yml | 39 +++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/jekyll-docker.yml diff --git a/.github/workflows/jekyll-docker.yml b/.github/workflows/jekyll-docker.yml new file mode 100644 index 00000000..ab0bfe96 --- /dev/null +++ b/.github/workflows/jekyll-docker.yml @@ -0,0 +1,39 @@ +name: Jekyll site CI + +on: + push: + branches: [ "main" ] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - 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 \ + "apk update && \ + apk add py3-pygments && \ + chmod -R 777 /srv/jekyll && \ + jekyll build --config _config.yml,_config-fvwm2rc.yml" + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: ${{ github.workspace }}/_site + # Deployment job + deploy: + permissions: + pages: write # to deploy to Pages + id-token: write # to verify deployment from a trusted source + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4