Skip to content

Commit edf1372

Browse files
committed
Update deploy job
Switch to official GH Pages Action https://github.com/marketplace/actions/deploy-github-pages-site
1 parent 679ad4c commit edf1372

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

.github/workflows/deploy.yml

+16-13
Original file line numberDiff line numberDiff line change
@@ -29,24 +29,27 @@ jobs:
2929
- name: Upload production-ready build files
3030
uses: actions/upload-artifact@v4
3131
with:
32-
name: production-files
32+
name: github-pages
3333
path: ./dist
3434

3535
deploy:
3636
name: Deploy
37+
# Add a dependency to the build job
3738
needs: build
38-
runs-on: ubuntu-latest
39-
if: github.ref == 'refs/heads/main'
4039

41-
steps:
42-
- name: Download artifact
43-
uses: actions/download-artifact@v4
44-
with:
45-
name: production-files
46-
path: ./dist
40+
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
41+
permissions:
42+
pages: write # to deploy to Pages
43+
id-token: write # to verify the deployment originates from an appropriate source
4744

45+
# Deploy to the github-pages environment
46+
environment:
47+
name: github-pages
48+
url: ${{ steps.deployment.outputs.page_url }}
49+
50+
# Specify runner + deployment step
51+
runs-on: ubuntu-latest
52+
steps:
4853
- name: Deploy to GitHub Pages
49-
uses: peaceiris/actions-gh-pages@v3
50-
with:
51-
github_token: ${{ secrets.GITHUB_TOKEN }}
52-
publish_dir: ./dist
54+
id: deployment
55+
uses: actions/deploy-pages@v4 # or specific "vX.X.X" version tag for this action

0 commit comments

Comments
 (0)