From 17d9982ad3d9a5305fbfae7e5150e5ef4ebfa52c Mon Sep 17 00:00:00 2001 From: Ryan Nixon Date: Sat, 15 Jul 2023 08:08:09 -0700 Subject: [PATCH] Update GH pages workflow, bump Hugo --- .github/workflows/gh-pages.yml | 46 ++++++++++++++++++++++++++++------ .gitignore | 1 + .tool-versions | 1 + 3 files changed, 41 insertions(+), 7 deletions(-) create mode 100644 .tool-versions diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 0b8f633..18bce29 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -6,11 +6,26 @@ on: branches: - main +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: "pages" + cancel-in-progress: false + +defaults: + run: + shell: bash + jobs: - deploy: + build: runs-on: ubuntu-20.04 + env: + HUGO_VERSION: 0.114.0 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: submodules: true # Fetch Hugo themes (true OR recursive) fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod @@ -18,13 +33,30 @@ jobs: - name: Setup Hugo uses: peaceiris/actions-hugo@v2 with: - hugo-version: "0.80.0" + hugo-version: ${{ env.HUGO_VERSION }} + + - name: Setup Pages + id: pages + uses: actions/configure-pages@v3 - name: Build + env: + HUGO_ENVIRONMENT: production + HUGO_ENV: production run: hugo --minify - - name: Deploy - uses: peaceiris/actions-gh-pages@v3 + - name: Upload artifact + uses: actions/upload-pages-artifact@v2 with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./public + path: ./public + + deploy: + runs-on: ubuntu-20.04 + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v2 diff --git a/.gitignore b/.gitignore index 592a6ea..dd8b36f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .DS_Store public +.hugo_build.lock diff --git a/.tool-versions b/.tool-versions new file mode 100644 index 0000000..6b033f4 --- /dev/null +++ b/.tool-versions @@ -0,0 +1 @@ +hugo 0.114.0