Documentation Site #328
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] | |
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@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 | |
with: | |
lfs: true | |
submodules: recursive | |
- name: Setup go | |
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5 | |
with: | |
cache-dependency-path: '**/go.mod' | |
- 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@50769540e7f4bd5e21e526ee35c689e35e0d6874 # 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@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 | |
- name: Download Artifact | |
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4 | |
with: | |
name: site | |
path: docs/public/ | |
- name: Setup Pages | |
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5 | |
- name: Upload Pages Artifact | |
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3 | |
with: | |
path: docs/public/ | |
- name: Deploy to Github Pages | |
id: deployment | |
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4 |