| 1 | name: Deploy site |
| 2 | run-name: Deploy site ${{ inputs.release_version && format('v{0}', inputs.release_version) || github.sha }} |
| 3 | |
| 4 | on: |
| 5 | push: |
| 6 | branches: [main-v2] |
| 7 | paths: ['site/**', 'release-notes/**', '.github/workflows/pages.yml'] |
| 8 | workflow_dispatch: |
| 9 | inputs: |
| 10 | release_version: |
| 11 | description: "Optional release version that owns this deployment" |
| 12 | required: false |
| 13 | default: "" |
| 14 | type: string |
| 15 | |
| 16 | permissions: |
| 17 | contents: read |
| 18 | pages: write |
| 19 | id-token: write |
| 20 | |
| 21 | concurrency: |
| 22 | group: pages |
| 23 | cancel-in-progress: false |
| 24 | |
| 25 | jobs: |
| 26 | build: |
| 27 | runs-on: ubuntu-latest |
| 28 | steps: |
| 29 | - uses: actions/checkout@v7 |
| 30 | - uses: actions/setup-node@v7 |
| 31 | with: |
| 32 | node-version: '22' |
| 33 | cache: npm |
| 34 | cache-dependency-path: site/package-lock.json |
| 35 | - name: Build |
| 36 | working-directory: site |
| 37 | env: |
| 38 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 39 | run: | |
| 40 | npm ci |
| 41 | npm run build |
| 42 | - uses: actions/upload-pages-artifact@v5 |
| 43 | with: |
| 44 | path: site/dist |
| 45 | |
| 46 | deploy: |
| 47 | needs: build |
| 48 | runs-on: ubuntu-latest |
| 49 | environment: |
| 50 | name: github-pages |
| 51 | url: ${{ steps.deploy.outputs.page_url }} |
| 52 | steps: |
| 53 | - id: deploy |
| 54 | uses: actions/deploy-pages@v5 |
| 55 |