Files

74 lines
1.4 KiB
YAML

name: Deploy Site
on:
push:
branches:
- main
paths:
- "site/**"
- ".github/workflows/deploy-site.yml"
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: site
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Pages
id: pages
uses: actions/configure-pages@v5
with:
enablement: true
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.22"
cache-dependency-path: site/go.sum
- name: Setup Hugo
uses: peaceiris/actions-hugo@v3
with:
hugo-version: "0.147.0"
extended: true
- name: Download Hugo Modules
run: |
hugo mod get
hugo mod verify
- name: Build
run: hugo --minify --baseURL "${{ steps.pages.outputs.base_url }}/"
- name: Upload Pages Artifact
uses: actions/upload-pages-artifact@v3
with:
path: site/public
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4