Skip to content

Commit 631c0f2

Browse files
committed
update the deploy yaml
1 parent b3bb942 commit 631c0f2

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
11
name: Deploy to GitHub Pages
22

33
on:
4-
# You can choose which events trigger the deploy.
54
push:
6-
branches:
7-
- main # Deploy to gh-pages whenever you push to main
5+
branches:
6+
- main
87
workflow_dispatch:
98

109
jobs:
1110
build-and-deploy:
1211
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write # <-- Important: allows pushing to the repo
1314

1415
steps:
1516
- name: Check out the code
1617
uses: actions/checkout@v3
18+
with:
19+
persist-credentials: false # sometimes helpful for clarity
1720

1821
- name: Use Node
1922
uses: actions/setup-node@v3
@@ -30,8 +33,7 @@ jobs:
3033
uses: peaceiris/actions-gh-pages@v3
3134
with:
3235
github_token: ${{ secrets.GITHUB_TOKEN }}
33-
publish_dir: ./dist # Directory with the build output
34-
# If you want to force-push (e.g., to remove old files completely):
35-
# force_orphan: gh-pages
36-
# If you want a custom commit message:
37-
# commit_message: Deploy from GitHub Actions
36+
publish_dir: ./dist
37+
publish_branch: gh-pages # Explicitly set the target branch
38+
force_orphan: true # Creates or overwrites branch if needed
39+
commit_message: "Deploy from GitHub Actions"

0 commit comments

Comments
 (0)