From 2fc8b5918277f9329ac5d02a9e19e6f4b1198e8e Mon Sep 17 00:00:00 2001 From: Craig Buchek Date: Sun, 3 Mar 2024 22:37:06 -0800 Subject: [PATCH] GitHub Actions: update Publish to GitHub Pages --- .github/workflows/hugo-publish-github-pages.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/hugo-publish-github-pages.yml b/.github/workflows/hugo-publish-github-pages.yml index a175a01..1eb541c 100644 --- a/.github/workflows/hugo-publish-github-pages.yml +++ b/.github/workflows/hugo-publish-github-pages.yml @@ -8,6 +8,7 @@ on: push: branches: - main + - master # Allow running this workflow manually from the Actions tab. workflow_dispatch: @@ -34,11 +35,11 @@ jobs: steps: - name: Install Hugo CLI run: | - LATEST_RELEASE_JSON=$(curl -s https://api.github.com/repos/gohugoio/hugo/releases/latest) - HUGO_VERSION=$(echo $LATEST_RELEASE_JSON | jq -r '.tag_name') - HUGO_DEB_URL="https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb" - wget -O "${{ runner.temp }}/hugo.deb" "$HUGO_DEB_URL" - sudo dpkg -i ${{ runner.temp }}/hugo.deb + HUGO_LATEST_RELEASE_JSON=$(curl -s https://api.github.com/repos/gohugoio/hugo/releases/latest) + HUGO_VERSION=$(echo $HUGO_LATEST_RELEASE_JSON | tr -cd '[:print:]' | jq -r '.tag_name' | cut -c2-) + HUGO_DEB_URL="https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb" + wget -O "${{ runner.temp }}/hugo.deb" "$HUGO_DEB_URL" \ + && sudo dpkg -i ${{ runner.temp }}/hugo.deb # - name: Install Dart Sass # run: sudo snap install dart-sass @@ -72,12 +73,12 @@ jobs: with: path: ./public - deploy: + hugo-deploy: environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} runs-on: ubuntu-latest - needs: build + needs: hugo-build steps: - name: Deploy to GitHub Pages id: deployment