From 011331ee0c102b81ffecdf317f2fe6baf09559ca Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Wed, 26 Jul 2023 08:26:56 +0100 Subject: [PATCH] Deploy to GitHub pages --- .github/workflows/ci.yml | 46 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..78012ab --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,46 @@ +name: CI + +on: [push, pull_request] + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: "pages" + cancel-in-progress: true + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Run Hugo + uses: crazy-max/ghaction-hugo@v2 + with: + version: latest + extended: true + args: --minify --verbose + + - name: Upload artifact + uses: actions/upload-pages-artifact@v1 + with: + path: ./public + + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + + needs: + - build + + if: github.ref_name == 'master' + + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v1