Skip to content

Merge pull request #40 from complytime/dependabot/github_actions/acti… #37

Merge pull request #40 from complytime/dependabot/github_actions/acti…

Merge pull request #40 from complytime/dependabot/github_actions/acti… #37

---
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@df4cb1c069e1874edd31b4311f1884172cec0e10
- 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@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e
with:
node-version: '22'
- name: Setup Hugo
uses: peaceiris/actions-hugo@2752ce1d29631191ea3f27c23495fa06139a5b78
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@fc324d3547104276b827a68afc52ff2a11cc49c9
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@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5.0.0