| 1 | name: Site |
| 2 | |
| 3 | on: |
| 4 | push: |
| 5 | branches: [main] |
| 6 | paths: |
| 7 | - 'site/**' |
| 8 | - '.github/workflows/site.yml' |
| 9 | pull_request: |
| 10 | branches: [main] |
| 11 | paths: |
| 12 | - 'site/**' |
| 13 | - '.github/workflows/site.yml' |
| 14 | workflow_dispatch: |
| 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 | name: Build |
| 28 | runs-on: ubuntu-latest |
| 29 | defaults: |
| 30 | run: |
| 31 | working-directory: site |
| 32 | steps: |
| 33 | - uses: actions/checkout@v4 |
| 34 | - uses: actions/setup-node@v4 |
| 35 | with: |
| 36 | node-version: '22' |
| 37 | cache: 'npm' |
| 38 | cache-dependency-path: site/package-lock.json |
| 39 | - run: npm ci |
| 40 | - run: npm run build |
| 41 | - run: cp src/CNAME dist/CNAME |
| 42 | - uses: actions/upload-pages-artifact@v3 |
| 43 | with: |
| 44 | path: site/dist |
| 45 | |
| 46 | deploy: |
| 47 | name: Deploy |
| 48 | if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request' |
| 49 | needs: build |
| 50 | runs-on: ubuntu-latest |
| 51 | environment: |
| 52 | name: github-pages |
| 53 | url: ${{ steps.deployment.outputs.page_url }} |
| 54 | steps: |
| 55 | - id: deployment |
| 56 | uses: actions/deploy-pages@v4 |