|
| 1 | +# .github/workflows/deploy.yml |
1 | 2 | name: Build & Deploy to GitHub Pages |
2 | 3 |
|
| 4 | +# Only run on real source changes to main (ignore dist/ uploads) |
3 | 5 | on: |
4 | 6 | push: |
5 | 7 | branches: [ main ] |
|
9 | 11 | pull_request: |
10 | 12 | branches: [ main ] |
11 | 13 |
|
| 14 | +# Grant the Pages actions the rights they need |
| 15 | +permissions: |
| 16 | + contents: read # for checkout |
| 17 | + pages: write # to publish the site |
| 18 | + id-token: write # if you use OIDC (not strictly needed here) |
| 19 | + |
12 | 20 | jobs: |
13 | 21 | build: |
14 | 22 | runs-on: ubuntu-latest |
15 | 23 | strategy: |
16 | 24 | matrix: |
17 | | - node-version: [18.x,20.x,22.x] |
| 25 | + node-version: [18.x, 20.x, 22.x] |
18 | 26 |
|
19 | 27 | steps: |
20 | | - - uses: actions/checkout@v4 |
| 28 | + - name: Checkout source |
| 29 | + uses: actions/checkout@v4 |
21 | 30 |
|
22 | | - - name: Setup Node.js ${{ matrix.node-version }} |
23 | | - uses: actions/setup-node@v4 |
24 | | - with: |
25 | | - node-version: ${{ matrix.node-version }} |
| 31 | + - name: Set up Node.js ${{ matrix.node-version }} |
| 32 | + uses: actions/setup-node@v4 |
| 33 | + with: |
| 34 | + node-version: ${{ matrix.node-version }} |
26 | 35 |
|
27 | | - - name: Install & build |
28 | | - run: | |
29 | | - npm ci |
30 | | - npm run build |
| 36 | + - name: Install & Build |
| 37 | + run: | |
| 38 | + npm ci |
| 39 | + npm run build |
31 | 40 |
|
32 | | - - name: Configure Pages |
33 | | - uses: actions/configure-pages@v3 |
| 41 | + - name: Configure Pages |
| 42 | + uses: actions/configure-pages@v3 |
34 | 43 |
|
35 | | - - name: Upload artifact |
36 | | - uses: actions/upload-pages-artifact@v1 |
37 | | - with: |
38 | | - path: ./dist |
| 44 | + - name: Upload built site |
| 45 | + uses: actions/upload-pages-artifact@v1 |
| 46 | + with: |
| 47 | + path: dist |
39 | 48 |
|
40 | 49 | deploy: |
41 | | - needs: build |
42 | 50 | runs-on: ubuntu-latest |
| 51 | + needs: build |
43 | 52 | steps: |
44 | | - - name: Deploy to GitHub Pages |
45 | | - uses: actions/deploy-pages@v1 |
| 53 | + - name: Deploy to GitHub Pages |
| 54 | + uses: actions/deploy-pages@v1 |
0 commit comments