File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11name : Deploy to GitHub Pages
22
33on :
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
109jobs :
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
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"
You can’t perform that action at this time.
0 commit comments