Build hugo site #885
This file contains 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: Build hugo site | |
on: | |
push: | |
branches: [ main ] | |
paths-ignore: | |
- ".github/**" | |
- ".README" | |
workflow_run: | |
workflows: ["Update release notes"] | |
types: | |
- completed | |
jobs: | |
build-site: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
submodules: true | |
fetch-depth: 1 | |
# install dependencies in hugo-theme | |
- run: npm install | |
- name: Setup Hugo | |
uses: peaceiris/actions-hugo@75d2e84710de30f6ff7268e08f310b60ef14033f # 3.0.0 | |
with: | |
hugo-version: 'latest' | |
extended: true | |
- name: Build with Hugo | |
run: hugo --environment production -F --minify | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # 4.0.0 | |
if: github.ref == 'refs/heads/main' | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./public |