Merge pull request #163 from banana-three-join/chore/banana-three-joi… #30
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: Build and Deploy Site | |
| on: | |
| push: | |
| branches: [master] | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| defaults: | |
| run: | |
| shell: bash | |
| jobs: | |
| build-and-deploy-site: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: go.mod | |
| cache: true | |
| - name: Setup Hugo Extended | |
| uses: peaceiris/actions-hugo@v3 | |
| with: | |
| hugo-version: '0.158.0' | |
| extended: true | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Setup site dependencies | |
| run: make setup | |
| # Production build. The GitHub Pages base URL is per-fork, so it is passed here directly | |
| # rather than baked into config or the standardized scripts. | |
| # Mirrors 'npm run build:production' (hugo --cleanDestinationDir --minify --gc). | |
| - name: Build site | |
| run: | | |
| BASE_URL="https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/" | |
| hugo --cleanDestinationDir --gc --minify --baseURL "${BASE_URL}" | |
| - name: Prepare Pages output | |
| run: touch public/.nojekyll | |
| - name: Deploy site to GitHub Pages | |
| uses: peaceiris/actions-gh-pages@v4 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_branch: gh-pages | |
| publish_dir: ./public | |
| keep_files: true |