Skip to content

Docs Site

Docs Site #3

Workflow file for this run

name: Docs Site
on:
push:
tags:
- "v*"
workflow_dispatch:
# Branch push and pull request triggers are intentionally omitted. Version tags
# keep docs in step with stable builds, and workflow_dispatch lets maintainers
# publish small main-branch docs edits without waiting for another release.
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: false
jobs:
build:
name: Build docs site
runs-on: ubuntu-latest
env:
GO_VERSION: "1.25.3"
HUGO_VERSION: "0.160.0"
NODE_VERSION: "24"
steps:
- name: Check out repository
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: |
go.sum
site/go.sum
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
cache-dependency-path: site/package-lock.json
- name: Set up Pages
id: pages
if: ${{ vars.DOCS_SITE_DEPLOY_ENABLED == 'true' }}
uses: actions/configure-pages@v6
- name: Install Hugo
run: |
mkdir -p "${HOME}/.local/hugo"
curl -sL "https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.tar.gz" \
| tar -xz -C "${HOME}/.local/hugo"
echo "${HOME}/.local/hugo" >> "${GITHUB_PATH}"
- name: Install Node.js dependencies
working-directory: site
run: npm ci
- name: Check generated docs
run: go run ./cmd/restish-docgen --check
- name: Generate social preview images
working-directory: site
run: npm run social-images
- name: Build site
if: ${{ vars.DOCS_SITE_DEPLOY_ENABLED != 'true' }}
run: |
hugo --source site --quiet --gc --minify \
--cacheDir "${{ runner.temp }}/hugo_cache"
- name: Build Pages artifact
if: ${{ vars.DOCS_SITE_DEPLOY_ENABLED == 'true' }}
run: |
hugo --source site --quiet --gc --minify \
--baseURL "${{ steps.pages.outputs.base_url }}/" \
--cacheDir "${{ runner.temp }}/hugo_cache"
- name: Check docs links
run: scripts/check-doc-links.rb
- name: Check docs examples
run: scripts/check-doc-examples.rb
- name: Upload Pages artifact
if: ${{ vars.DOCS_SITE_DEPLOY_ENABLED == 'true' }}
uses: actions/upload-pages-artifact@v5
with:
path: site/public
deploy:
name: Deploy docs site
if: ${{ vars.DOCS_SITE_DEPLOY_ENABLED == 'true' }}
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5