docs: fix documentation deployment #252
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: Deploy Documentation | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
doc: | |
name: Build and deploy documentation | |
runs-on: ubuntu-latest | |
env: | |
# https://github.com/actions/setup-go#supported-version-syntax | |
# ex: | |
# - 1.18beta1 -> 1.18.0-beta.1 | |
# - 1.18rc1 -> 1.18.0-rc.1 | |
GO_VERSION: '1.24' | |
HUGO_VERSION: 0.148.1 | |
CGO_ENABLED: 0 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
- run: go mod download | |
- name: Setup Hugo | |
run: | | |
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \ | |
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb | |
- name: Build Documentation assets | |
run: make website_copy_jsonschema website_expand_templates | |
- name: Build Documentation | |
env: | |
# For maximum backward compatibility with Hugo modules | |
HUGO_ENVIRONMENT: production | |
HUGO_ENV: production | |
working-directory: ./docs | |
run: | | |
hugo \ | |
--gc --minify \ | |
--baseURL "https://golangci-lint.run/" | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v4 | |
with: | |
publish_dir: docs/public | |
force_orphan: true | |
github_token: ${{ secrets.GOLANGCI_LINT_TOKEN }} |