@@ -17,13 +17,27 @@ jobs:
1717 with :
1818 node-version-file : ' .nvmrc'
1919 cache : npm
20+ - name : Cache node_modules
21+ id : cache-node_modules
22+ uses : actions/cache@v2
23+ env :
24+ cache-name : cache-node_modules
25+ with :
26+ path : node_modules
27+ key : ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('yarn.lock') }}
28+ restore-keys : |
29+ ${{ runner.os }}-build-${{ env.cache-name }}-
30+ ${{ runner.os }}-build-
31+ ${{ runner.os }}-
2032 - name : Install deps
33+ if : steps.cache-node_modules.outputs.cache-hit != 'true'
2134 run : yarn install
2235 - name : Lint
2336 run : yarn lint
2437
2538 build :
26- name : ' Build'
39+ name : ' Build + Release'
40+ needs : [lint]
2741 runs-on : ubuntu-latest
2842 steps :
2943 - name : Checkout
@@ -33,33 +47,27 @@ jobs:
3347 with :
3448 node-version-file : ' .nvmrc'
3549 cache : npm
50+ - name : Cache node_modules
51+ id : cache-node_modules
52+ uses : actions/cache@v2
53+ env :
54+ cache-name : cache-node_modules
55+ with :
56+ path : node_modules
57+ key : ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('yarn.lock') }}
58+ restore-keys : |
59+ ${{ runner.os }}-build-${{ env.cache-name }}-
60+ ${{ runner.os }}-build-
61+ ${{ runner.os }}-
3662 - name : Install deps
63+ if : steps.cache-node_modules.outputs.cache-hit != 'true'
3764 run : yarn install
3865 - name : TS build
3966 run : yarn build
40- - name : Docker build
41- run : docker build .
42-
43- release :
44- name : Semantic release
45- if : github.event_name == 'push' && github.ref == 'refs/heads/main'
46- needs : [lint, build]
47- runs-on : ubuntu-latest
48- steps :
49- - name : Checkout
50- uses : actions/checkout@v2
51- with :
52- persist-credentials : false
53- - name : Setup node
54- uses : actions/setup-node@v2
55- with :
56- node-version-file : ' .nvmrc'
57- cache : npm
58- - name : Install deps
59- run : yarn install
6067 - name : Docker build
6168 run : docker build . -t node-http-rendezvous-server
6269 - name : Release
70+ if : github.event_name == 'push' && github.ref == 'refs/heads/main'
6371 run : yarn release
6472 env :
6573 GITHUB_USER : ${{ github.actor }}
0 commit comments