update workflow #10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy Hugo site to GitHub Pages | |
on: | |
push: | |
branches: | |
- documentation | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: '1.24' | |
- name: Install Go modules | |
run: | | |
go mod tidy | |
go mod vendor | |
- name: Setup Hugo | |
uses: peaceiris/actions-hugo@v2 | |
with: | |
hugo-version: '0.145.0' | |
extended: true | |
- name: Build site | |
run: hugo --minify | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: ./public | |
deploy: | |
needs: build | |
runs-on: ubuntu-latest | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v2 |