Skip to content

Merge pull request #19 from complytime/automated/content-sync-update #18

Merge pull request #19 from complytime/automated/content-sync-update

Merge pull request #19 from complytime/automated/content-sync-update #18

---
name: Deploy Hugo to GitHub Pages
on:
push:
branches: main
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- name: Setup Go
uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
with:
go-version-file: go.mod
- name: Setup Node.js
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238
with:
node-version: '22'
- name: Setup Hugo
uses: peaceiris/actions-hugo@75d2e84710de30f6ff7268e08f310b60ef14033f
with:
hugo-version: '0.155.1'
extended: true
- name: Install dependencies
run: npm ci
- name: Go vet
run: go vet ./...
- name: Check formatting
run: |
unformatted=$(gofmt -l ./cmd/sync-content/)
if [ -n "$unformatted" ]; then
echo "::error::Unformatted Go files:"
echo "$unformatted"
exit 1
fi
- name: Run tests
run: go test -race ./cmd/sync-content/...
- name: Sync content
run: go run ./cmd/sync-content --org complytime --config sync-config.yaml --lock .content-lock.json --write
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build
run: hugo --minify --gc
- name: Upload artifact
uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b
with:
path: ./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@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5