File tree Expand file tree Collapse file tree 2 files changed +36
-26
lines changed Expand file tree Collapse file tree 2 files changed +36
-26
lines changed Original file line number Diff line number Diff line change 1
1
name : Deploy to GitHub Pages
2
2
3
3
on :
4
- pull_request :
5
- branches : [main]
6
4
push :
7
- branches : [main]
5
+ branches :
6
+ - main
8
7
9
8
jobs :
10
- test- deploy :
11
- if : github.event_name != 'push'
9
+ deploy :
10
+ name : Deploy to GitHub Pages
12
11
runs-on : ubuntu-latest
13
12
steps :
14
13
- uses : actions/checkout@v3
15
14
- uses : actions/setup-node@v3
16
15
with :
17
16
node-version : 16
18
17
cache : yarn
18
+
19
19
- name : Install dependencies
20
- run : yarn install
21
- - name : Test build website
20
+ run : yarn install --frozen-lockfile
21
+ - name : Build website
22
22
run : yarn build
23
- deploy :
24
- if : github.event_name != 'pull_request'
25
- runs-on : ubuntu-latest
26
- steps :
27
- - uses : actions/checkout@v3
28
- - uses : actions/setup-node@v3
29
- with :
30
- node-version : 16
31
- cache : yarn
32
- - uses : webfactory/ssh-agent@v0.5.0
33
- with :
34
- ssh-private-key : ${{ secrets.GH_PAGES_DEPLOY }}
23
+
35
24
- name : Deploy to GitHub Pages
36
- env :
37
- USE_SSH : true
38
- run : |
39
- git config --global user.name "fullstack-devops[bot]"
40
- git config --global user.email "fullstack-devops[bot]@users.noreply.github.com"
41
- yarn install
42
- yarn deploy
25
+ uses : peaceiris/actions-gh-pages@v3
26
+ with :
27
+ github_token : ${{ secrets.GITHUB_TOKEN }}
28
+ publish_dir : ./build
29
+ user_name : fullstack-devops[bot]
30
+ user_email : fullstack-devops[bot]@users.noreply.github.com
Original file line number Diff line number Diff line change
1
+ name : Test deployment
2
+
3
+ on :
4
+ pull_request :
5
+ branches :
6
+ - main
7
+
8
+ jobs :
9
+ test-deploy :
10
+ name : Test deployment
11
+ runs-on : ubuntu-latest
12
+ steps :
13
+ - uses : actions/checkout@v3
14
+ - uses : actions/setup-node@v3
15
+ with :
16
+ node-version : 16
17
+ cache : yarn
18
+
19
+ - name : Install dependencies
20
+ run : yarn install --frozen-lockfile
21
+ - name : Test build website
22
+ run : yarn build
You can’t perform that action at this time.
0 commit comments