Merge pull request #414 from DataDog/romain.marcadier/release/1.0.0-rc.1 #623
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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
with: | |
lfs: true | |
submodules: recursive | |
- name: Setup go | |
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # 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@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # 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@11bd71901bbe5b1630ceea73d27597364c9af683 # 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 |