1- name : Release & Deploy
1+ name : Release Please
22
33on :
44 push :
@@ -9,20 +9,14 @@ permissions:
99 actions : write
1010 contents : write
1111 pull-requests : write
12- pages : write
13- id-token : write
1412
1513concurrency :
1614 group : release-${{ github.ref }}
1715 cancel-in-progress : false
1816
1917jobs :
2018 release-please :
21- name : Release Please
2219 runs-on : ubuntu-latest
23- outputs :
24- release_created : ${{ steps.release.outputs.release_created }}
25- tag_name : ${{ steps.release.outputs.tag_name }}
2620 steps :
2721 - id : release
2822 uses : googleapis/release-please-action@v5
@@ -55,38 +49,12 @@ jobs:
5549 gh api -X DELETE "repos/$REPO/git/refs/heads/$BRANCH" 2>/dev/null || true
5650 gh workflow run "$WORKFLOW" -R "$REPO" --ref main
5751
58- deploy :
59- name : Deploy to GitHub Pages
60- needs : release-please
61- if : needs.release-please.outputs.release_created == 'true'
62- runs-on : ubuntu-latest
63- environment :
64- name : github-pages
65- url : ${{ steps.deployment.outputs.page_url }}
66- steps :
67- - uses : actions/checkout@v6
68- with :
69- ref : ${{ needs.release-please.outputs.tag_name }}
70-
71- - uses : actions/setup-node@v6
72- with :
73- node-version : 20
74- cache : npm
75-
76- - name : Install dependencies
77- run : npm ci
78-
79- - name : Build
80- run : npm run build
81-
82- - name : Setup Pages
83- uses : actions/configure-pages@v6
84-
85- - name : Upload Pages artifact
86- uses : actions/upload-pages-artifact@v5
87- with :
88- path : dist
89-
90- - name : Deploy
91- id : deployment
92- uses : actions/deploy-pages@v5
52+ # When a release is actually published, redeploy from main so the live
53+ # build carries the bumped version. release-please's own version-bump
54+ # commit is pushed by GITHUB_TOKEN and does NOT trigger the on:push deploy,
55+ # so the site would otherwise stay one release behind.
56+ - if : ${{ steps.release.outputs.release_created }}
57+ env :
58+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
59+ REPO : ${{ github.repository }}
60+ run : gh workflow run deploy.yml -R "$REPO" --ref main
0 commit comments