Skip to content

Documentation Site #1507

Documentation Site

Documentation Site #1507

Workflow file for this run

name: Documentation Site
on:
pull_request:
branches: ['**']
paths: [_docs/**]
merge_group:
branches: [main]
push:
branches: [main]
permissions: read-all
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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4
with:
lfs: true
submodules: recursive
- name: Setup go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v5
with:
go-version: stable
cache-dependency-path: '**/go.mod'
- name: Run doc generator
run: go -C _docs run ./generator
- 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@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4
- name: Download Artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
name: site
path: _docs/public/
- name: Setup Pages
uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6.0.0
- name: Upload Pages Artifact
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v3
with:
path: _docs/public/
- name: Deploy to Github Pages
id: deployment
uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5.0.0