| 1 | name: Squad Docs — Build & Deploy |
| 2 | |
| 3 | on: |
| 4 | workflow_dispatch: |
| 5 | push: |
| 6 | branches: [preview] |
| 7 | paths: |
| 8 | - 'docs/**' |
| 9 | - '.github/workflows/squad-docs.yml' |
| 10 | |
| 11 | permissions: |
| 12 | contents: read |
| 13 | pages: write |
| 14 | id-token: write |
| 15 | |
| 16 | concurrency: |
| 17 | group: pages |
| 18 | cancel-in-progress: true |
| 19 | |
| 20 | jobs: |
| 21 | build: |
| 22 | runs-on: ubuntu-latest |
| 23 | steps: |
| 24 | - uses: actions/checkout@v4 |
| 25 | |
| 26 | - uses: actions/setup-node@v4 |
| 27 | with: |
| 28 | node-version: '22' |
| 29 | cache: npm |
| 30 | cache-dependency-path: docs/package-lock.json |
| 31 | |
| 32 | - name: Install docs dependencies |
| 33 | working-directory: docs |
| 34 | run: npm ci |
| 35 | |
| 36 | - name: Build docs site |
| 37 | working-directory: docs |
| 38 | run: npm run build |
| 39 | |
| 40 | - name: Upload Pages artifact |
| 41 | uses: actions/upload-pages-artifact@v3 |
| 42 | with: |
| 43 | path: docs/dist |
| 44 | |
| 45 | deploy: |
| 46 | needs: build |
| 47 | runs-on: ubuntu-latest |
| 48 | environment: |
| 49 | name: github-pages |
| 50 | url: ${{ steps.deployment.outputs.page_url }} |
| 51 | steps: |
| 52 | - name: Deploy to GitHub Pages |
| 53 | id: deployment |
| 54 | uses: actions/deploy-pages@v4 |