Skip to content

Commit

Permalink
GitHub Actions: update Publish to GitHub Pages
Browse files Browse the repository at this point in the history
  • Loading branch information
booch committed Mar 4, 2024
1 parent adb531a commit 2fc8b59
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/hugo-publish-github-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
push:
branches:
- main
- master

# Allow running this workflow manually from the Actions tab.
workflow_dispatch:
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 2fc8b59

Please sign in to comment.