Documentation Site #27
Workflow file for this run
This file contains 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: Documentation Site | |
on: | |
pull_request: | |
branches: ['**'] | |
paths: [docs/**] | |
merge_group: | |
branches: ['main'] | |
push: | |
branches: [main] | |
paths: [docs/**] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
lfs: true | |
submodules: recursive | |
- name: Setup go | |
uses: actions/setup-go@v5 | |
with: | |
cache-dependency-path: '**/*.sum' | |
- name: Run go generate (builtin) | |
run: go generate ./internal/injector/builtin | |
- name: Build Site | |
run: go -C ./docs run github.com/gohugoio/hugo --minify --enableGitInfo | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: site | |
path: docs/public/ | |
if-no-files-found: error | |
publish: | |
runs-on: ubuntu-latest | |
needs: [build] | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
# Check out so that actions/configure-pages can access repository details... | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Download Artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: site | |
path: docs/public/ | |
- name: Setup Pages | |
uses: actions/configure-pages@v5 | |
- name: Upload Pages Artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: docs/public/ | |
- name: Deploy to Github Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |