File tree Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change 11# Documentation: https://help.github.com/en/articles/workflow-syntax-for-github-actions
2+ # Documentation: https://www.npmjs.com/package/gh-pages
23
34name : Continuous Deployment
45
56on :
67 push :
78 branches : [main]
9+ pull_request :
10+ types : [closed]
11+ branches : [main]
812
913jobs :
1014 deploy :
1115 name : Build and Deploy app to GitHub Pages
1216
1317 runs-on : ubuntu-latest
1418
19+ if : github.event.pull_request.merged == true || github.ref == 'refs/heads/main'
20+
1521 steps :
1622 - name : Checkout the code base
1723 uses : actions/checkout@v3
2733 - name : Build the project
2834 run : npm run build
2935
30- - name : Deploy to GitHub Pages
31- uses : peaceiris/actions-gh-pages@v3
32- with :
33- github_token : ${{ secrets.GH_TOKEN }}
34- publish_dir : ./build
35- force_orphan : true
36- user_name : ' github-actions[bot]'
37- user_email : ' github-actions[bot]@users.noreply.github.com'
38- full_commit_message : ' deploy: publish app to GitHub Pages'
36+ - name : Deploy with gh-pages
37+ run : |
38+ git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
39+ npm run deploy -- -u "github-actions-bot <[email protected] >" 40+ env :
41+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments