Skip to content

Commit 88e9c56

Browse files
committed
deploy to gh pages
1 parent fe050a6 commit 88e9c56

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

.github/workflows/deploy.yml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
11
# Documentation: https://help.github.com/en/articles/workflow-syntax-for-github-actions
2+
# Documentation: https://www.npmjs.com/package/gh-pages
23

34
name: Continuous Deployment
45

56
on:
67
push:
78
branches: [main]
9+
pull_request:
10+
types: [closed]
11+
branches: [main]
812

913
jobs:
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
@@ -27,12 +33,9 @@ jobs:
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 }}

0 commit comments

Comments
 (0)