[pre-commit.ci] pre-commit autoupdate (#635) #1751
This file contains hidden or 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: website | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| release: | |
| types: [published] | |
| # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: quarto-dev/quarto-actions/setup@v2 | |
| # Setting up the environment | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v5 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| enable-cache: true | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version-file: "pyproject.toml" | |
| - name: Install the project | |
| run: uv sync --all-extras | |
| # Building | |
| - name: Build HTML using uv | |
| run: | | |
| uv run make docs | |
| # Upload | |
| - name: Upload artifacts | |
| uses: actions/upload-pages-artifact@v4 | |
| with: | |
| name: github-pages | |
| retention-days: 7 | |
| path: site/ | |
| deploy: | |
| # Deploy to the github-pages environment | |
| # but not on PRs | |
| if: ${{ github.event_name != 'pull_request' }} | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| needs: build | |
| # Specify runner + deployment step | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 | |
| with: | |
| artifact_name: github-pages | |
| preview: true | |
| post-page-artifact: | |
| if: ${{ github.event_name == 'pull_request' }} | |
| needs: build | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Post comment preview | |
| uses: CDCgov/cfa-actions/[email protected] | |
| with: | |
| artifact-name: github-pages | |
| gh-token: ${{ secrets.GITHUB_TOKEN}} |