[pull] main from DataDog:main #4756
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: dev docs | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- docs/** | |
- .github/workflows/docs-dev.yml | |
pull_request: | |
branches: | |
- main | |
paths: | |
- docs/** | |
- .github/workflows/docs-dev.yml | |
permissions: {} | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: ${{ github.event_name == 'pull_request' && true || false }} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 | |
with: | |
persist-credentials: false | |
# Fetch all history for applying timestamps to every page | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0 | |
with: | |
python-version: '3.12' | |
- name: Install dependencies | |
run: pip install -r tasks/requirements.txt | |
- name: Configure Git for GitHub Actions bot | |
run: | | |
git config --local user.name 'github-actions[bot]' | |
git config --local user.email 'github-actions[bot]@users.noreply.github.com' | |
- name: Validate documentation | |
run: invoke docs.build --validate | |
- name: Build documentation | |
run: invoke docs.build | |
- uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6 | |
with: | |
name: documentation | |
path: site | |
publish: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
needs: | |
- build | |
steps: | |
- uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 | |
with: | |
name: documentation | |
path: site | |
- uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: site | |
commit_message: ${{ github.event.head_commit.message }} | |
# Write .nojekyll at the root, see: | |
# https://help.github.com/en/github/working-with-github-pages/about-github-pages#static-site-generators | |
enable_jekyll: false | |
# Only deploy if there were changes | |
allow_empty_commit: false |