|
1 | | -name: Deploy pages |
| 1 | +name: Run Release Please |
2 | 2 |
|
3 | 3 | on: |
4 | | - workflow_dispatch: |
5 | 4 | push: |
6 | | - branches: [main] |
7 | | - |
8 | | -permissions: |
9 | | - contents: read |
10 | | - pages: write |
11 | | - id-token: write |
| 5 | + branches: |
| 6 | + - main |
12 | 7 |
|
13 | 8 | concurrency: |
14 | | - group: pages |
| 9 | + group: deploy-${{ github.ref }} |
15 | 10 | cancel-in-progress: false |
16 | 11 |
|
| 12 | +permissions: |
| 13 | + contents: read |
| 14 | + |
17 | 15 | jobs: |
18 | | - build: |
| 16 | + release-please: |
| 17 | + permissions: |
| 18 | + id-token: write # for googleapis/release-please-action to create release tag |
| 19 | + contents: write # for googleapis/release-please-action to create release commit |
| 20 | + pull-requests: write # for googleapis/release-please-action to create release PR |
| 21 | + runs-on: ubuntu-latest |
| 22 | + |
| 23 | + steps: |
| 24 | + - uses: googleapis/release-please-action@16a9c90856f42705d54a6fda1823352bdc62cf38 # v4 |
| 25 | + id: release |
| 26 | + with: |
| 27 | + token: ${{ secrets.RELEASE_PLEASE_ACTION_TOKEN }} |
| 28 | + |
| 29 | + outputs: |
| 30 | + release_created: ${{ steps.release.outputs.release_created }} |
| 31 | + |
| 32 | + publish-npm: |
19 | 33 | runs-on: ubuntu-latest |
| 34 | + needs: release-please |
| 35 | + permissions: |
| 36 | + id-token: write # npm provenance |
| 37 | + contents: read |
| 38 | + if: ${{ fromJSON(needs.release-please.outputs.release_created || false) }} |
20 | 39 |
|
21 | 40 | steps: |
22 | | - - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 #v6.0.1 |
| 41 | + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 |
23 | 42 |
|
24 | | - - uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 #v6.2.0 |
| 43 | + - uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 |
25 | 44 | with: |
26 | | - node-version: "lts/*" |
| 45 | + node-version-file: ".nvmrc" |
| 46 | + registry-url: https://registry.npmjs.org |
27 | 47 |
|
28 | | - - name: Setup @antfu/ni |
29 | | - run: npm i -g @antfu/ni |
| 48 | + - name: Install dependencies |
| 49 | + run: npm ci |
| 50 | + |
| 51 | + - name: Publish package |
| 52 | + run: npm publish --provenance --access public |
| 53 | + |
| 54 | + build-pages: |
| 55 | + runs-on: ubuntu-latest |
| 56 | + needs: release-please |
| 57 | + permissions: |
| 58 | + contents: read |
| 59 | + pages: write |
| 60 | + id-token: write |
| 61 | + if: ${{ fromJSON(needs.release-please.outputs.release_created || false) }} |
| 62 | + |
| 63 | + steps: |
| 64 | + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 |
| 65 | + |
| 66 | + - uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 |
| 67 | + with: |
| 68 | + node-version: lts/* |
30 | 69 |
|
31 | 70 | - name: Install dependencies |
32 | | - run: nci |
| 71 | + run: npm ci |
33 | 72 |
|
34 | 73 | - name: Build |
35 | | - run: nr build --base /${{github.event.repository.name}}/ --without-notes |
| 74 | + run: npm run build -- --base /${{ github.event.repository.name }}/ --without-notes |
36 | 75 | env: |
37 | | - NODE_OPTIONS: "--max-old-space-size=4096" |
| 76 | + NODE_OPTIONS: --max-old-space-size=4096 |
38 | 77 |
|
39 | 78 | - name: Setup Pages |
40 | | - uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b #v5.0.0 |
| 79 | + uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5.0.0 |
41 | 80 |
|
42 | | - - uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b #v4.0.0 |
| 81 | + - uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4.0.0 |
43 | 82 | with: |
44 | 83 | path: dist |
45 | 84 |
|
46 | | - deploy: |
| 85 | + deploy-pages: |
| 86 | + name: Deploy Pages |
| 87 | + runs-on: ubuntu-latest |
| 88 | + needs: |
| 89 | + - release-please |
| 90 | + - build-pages |
| 91 | + permissions: |
| 92 | + pages: write |
| 93 | + id-token: write |
| 94 | + if: ${{ fromJSON(needs.release-please.outputs.release_created || false) }} |
47 | 95 | environment: |
48 | 96 | name: github-pages |
49 | 97 | url: ${{ steps.deployment.outputs.page_url }} |
50 | | - needs: build |
51 | | - runs-on: ubuntu-latest |
52 | | - name: Deploy |
| 98 | + |
53 | 99 | steps: |
54 | 100 | - name: Deploy to GitHub Pages |
55 | 101 | id: deployment |
56 | | - uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e #v4.0.5 |
| 102 | + uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5 |
0 commit comments