Skip to content

Commit 21ddf64

Browse files
committed
Fix deploy workflow permissions and use official GitHub Pages action
1 parent e8b766f commit 21ddf64

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

.github/workflows/deploy.yml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ on:
99
jobs:
1010
build-and-deploy:
1111
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
14+
pages: write
15+
id-token: write
1216

1317
steps:
1418
- name: Checkout
@@ -30,9 +34,17 @@ jobs:
3034
- name: Build
3135
run: pnpm run build
3236

33-
- name: Deploy to GitHub Pages
34-
uses: peaceiris/actions-gh-pages@v3
37+
- name: Setup Pages
38+
uses: actions/configure-pages@v4
39+
if: github.ref == 'refs/heads/main'
40+
41+
- name: Upload artifact
42+
uses: actions/upload-pages-artifact@v3
3543
if: github.ref == 'refs/heads/main'
3644
with:
37-
github_token: ${{ secrets.GITHUB_TOKEN }}
38-
publish_dir: ./dist
45+
path: ./dist
46+
47+
- name: Deploy to GitHub Pages
48+
id: deployment
49+
uses: actions/deploy-pages@v4
50+
if: github.ref == 'refs/heads/main'

0 commit comments

Comments
 (0)