Skip to content

Documentation Site

Documentation Site #50

Workflow file for this run

name: Documentation Site
on:
pull_request:
branches: ['**']
paths: [docs/**]
merge_group:
branches: ['main']
push:
branches: [main]
paths: [docs/**]
workflow_dispatch:
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
# Set environment to anything other than "production", as the theme we use adds SRI attributes to all CSS files,
# but datadoghq.dev is behind CloudFlare with auto-minify enabled; which breaks SRI if its minification is not
# identical to hugo's.
run: go -C ./docs run github.com/gohugoio/hugo --minify --enableGitInfo --environment=gh-pages
- 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