@@ -109,20 +109,22 @@ jobs:
109109 env :
110110 NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
111111
112- # Generates API documentation for GitHub Pages on any release
113- # Supports both simple tags (v1.2.3) and package-scoped tags (@scope/package@1.2.3)
114- publish-gh-pages :
112+ # Generates API documentation and deploys to GitHub Pages on any release
113+ deploy-docs :
115114 runs-on : ubuntu-latest
116115 if : github.event_name == 'release'
117116 needs : [publish]
118117
119118 permissions :
120- contents : write
119+ pages : write
120+ id-token : write
121+
122+ environment :
123+ name : github-pages
124+ url : ${{ steps.deployment.outputs.page_url }}
121125
122126 steps :
123127 - uses : actions/checkout@v4
124- with :
125- fetch-depth : 0 # Fetch all history for all branches and tags
126128
127129 - name : Install pnpm
128130 uses : pnpm/action-setup@v4
@@ -137,13 +139,20 @@ jobs:
137139 - name : Install dependencies
138140 run : pnpm install
139141
140- - name : Configure Git
141- run : |
142- git config --global user.name "github-actions[bot]"
143- git config --global user.email "github-actions[bot]@users.noreply.github.com"
142+ - name : Build packages
143+ run : pnpm build:all
144144
145145 - name : Generate documentation
146- run : ./scripts/generate-gh-pages.sh "${{ github.ref_name }}"
146+ run : pnpm docs
147+
148+ - name : Configure Pages
149+ uses : actions/configure-pages@v5
150+
151+ - name : Upload Pages artifact
152+ uses : actions/upload-pages-artifact@v3
153+ with :
154+ path : tmp/docs
147155
148- - name : Push to gh-pages
149- run : git push origin gh-pages
156+ - name : Deploy to GitHub Pages
157+ id : deployment
158+ uses : actions/deploy-pages@v4
0 commit comments