3
3
pull_request :
4
4
types : [labeled, opened, synchronize]
5
5
6
- concurrency :
6
+ concurrency :
7
7
group : ${{ github.head_ref }}
8
8
cancel-in-progress : true
9
9
19
19
20
20
- name : compose a name for the build environment
21
21
run : echo "BUILD_ENV_NAME=pr-${{ github.event.number }}-${{ env.GITHUB_HEAD_REF_SLUG }}" >> $GITHUB_ENV
22
-
22
+
23
23
- uses : actions/checkout@v2
24
24
with :
25
25
ref : ${{ github.event.pull_request.head.sha }}
@@ -33,21 +33,20 @@ jobs:
33
33
with :
34
34
node-version : ' 14.x'
35
35
36
- # ref: https://github.com/actions/cache/blob/main/examples.md#node---yarn
37
- - name : Get yarn cache directory
38
- id : yarn-cache-dir-path
39
- run : echo "::set-output name=dir::$(yarn cache dir)"
40
-
41
- - name : Checking Yarn cache
42
- uses : actions/cache@v2
36
+ - name : Get npm cache directory
37
+ id : npm-cache-dir
38
+ run : |
39
+ echo "::set-output name=dir::$(npm config get cache)"
40
+ - uses : actions/cache@v2
41
+ id : npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true'
43
42
with :
44
- path : ${{ steps.yarn -cache-dir-path .outputs.dir }}
45
- key : ${{ runner.os }}-yarn -${{ hashFiles('**/yarn. lock') }}
43
+ path : ${{ steps.npm -cache-dir.outputs.dir }}
44
+ key : ${{ runner.os }}-node -${{ hashFiles('**/package- lock.json ') }}
46
45
restore-keys : |
47
- ${{ runner.os }}-yarn -
48
-
49
- - name : Yarn install
50
- run : npx yarn install --immutable
46
+ ${{ runner.os }}-node -
47
+
48
+ - name : Install dependencies
49
+ run : npm install --immutable
51
50
env :
52
51
NODE_ENV : ${{ secrets.NODE_ENV }}
53
52
@@ -61,10 +60,10 @@ jobs:
61
60
key : ${{ runner.os }}-gatsby-build-draft-${{ github.head_ref }}
62
61
63
62
- name : Fix mtimes
64
- run : yarn fix-mtimes --force
65
-
63
+ run : npm run fix-mtimes --force
64
+
66
65
- name : Gatsby build
67
- run : yarn build
66
+ run : npm run build
68
67
env :
69
68
APP_ENV : staging
70
69
NODE_ENV : ${{ secrets.NODE_ENV }}
85
84
github-deployment-environment : ${{ env.BUILD_ENV_NAME }}
86
85
env :
87
86
NETLIFY_AUTH_TOKEN : ${{ secrets.NETLIFY_AUTH_TOKEN }}
88
- NETLIFY_SITE_ID : ${{ secrets.NETLIFY_DEVELOP_SITE_ID }}
87
+ NETLIFY_SITE_ID : ${{ secrets.NETLIFY_DEVELOP_SITE_ID }}
89
88
0 commit comments