File tree 3 files changed +54
-19
lines changed
3 files changed +54
-19
lines changed Original file line number Diff line number Diff line change
1
+ name : Surge PR Preview - Build Stage
2
+
3
+ on :
4
+ pull_request :
5
+ types : [opened, synchronize, reopened]
6
+
7
+ jobs :
8
+ build-preview :
9
+ runs-on : ubuntu-latest
10
+
11
+ steps :
12
+ - name : checkout PR
13
+ uses : actions/checkout@v2
14
+ with :
15
+ ref : ${{ github.event.pull_request.head.sha }}
16
+
17
+ - name : build dist
18
+ run : |
19
+ npm install
20
+ npm run site:build
21
+
22
+ - name : upload dist artifact
23
+ uses : actions/upload-artifact@v2
24
+ with :
25
+ name : pr-build-dist
26
+ path : public/
Original file line number Diff line number Diff line change
1
+ name : Surge PR Preview - Upload Stage
2
+
3
+ on :
4
+ workflow_run :
5
+ workflows : ["Surge PR Preview - Build Stage"]
6
+ types :
7
+ - completed
8
+
9
+ jobs :
10
+ upload-preview :
11
+ runs-on : ubuntu-latest
12
+ if : ${{ github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' }}
13
+
14
+ steps :
15
+ - name : download dist artifact
16
+ uses : dawidd6/action-download-artifact@v2
17
+ with :
18
+ workflow : ${{ github.event.workflow_run.workflow_id }}
19
+ name : pr-build-dist
20
+ path : public/
21
+
22
+ - name : deploy to Surge
23
+ uses : afc163/surge-preview@v1
24
+ with :
25
+ surge_token : ${{ secrets.SURGE_TOKEN }}
26
+ github_token : ${{ secrets.GITHUB_TOKEN }}
27
+ build : echo done
28
+ dist : public
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments