Deploy GitHub Pages #49
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: Deploy GitHub Pages | |
| on: | |
| # Deploy only after CI passes on main | |
| workflow_run: | |
| workflows: ["CI"] | |
| branches: [ main ] | |
| types: [ completed ] | |
| # Allow manual re-deploy from the Actions tab | |
| workflow_dispatch: | |
| # Required permissions for the GITHUB_TOKEN to deploy Pages | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| # Only one Pages deployment runs at a time; skip queued runs but don't cancel in-progress | |
| concurrency: | |
| group: pages | |
| cancel-in-progress: false | |
| jobs: | |
| deploy: | |
| # Only deploy when the triggering CI run succeeded (or on manual dispatch) | |
| if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }} | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Configure GitHub Pages | |
| uses: actions/configure-pages@v5 | |
| - name: Upload docs/ as Pages artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: docs/ | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |