Skip to content

Commit 6b363f3

Browse files
nadiamoeRoberto Santalla
authored andcommitted
ci/pr-deploy: cache node modules and gatsby output
1 parent b119181 commit 6b363f3

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

.github/workflows/pr-deploy.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
with:
2727
node-version: '16.x'
2828
registry-url: 'https://registry.npmjs.org'
29+
cache: 'npm'
2930
- name: Restore cache
3031
uses: actions/cache@v2
3132
with:
@@ -45,6 +46,7 @@ jobs:
4546
with:
4647
node-version: '16.x'
4748
registry-url: 'https://registry.npmjs.org'
49+
cache: 'npm'
4850
- name: Restore cache
4951
uses: actions/cache@v2
5052
with:
@@ -94,10 +96,22 @@ jobs:
9496
with:
9597
node-version: '16.x'
9698
registry-url: 'https://registry.npmjs.org'
99+
cache: 'npm'
97100

98101
- name: Install
99102
run: npm install
100103

104+
- name: Restore build cache
105+
uses: actions/cache@v3
106+
with:
107+
# Gatsby requires both .cache and public. It will refuse to use .cache/ if public/ is not present.
108+
path: |
109+
.cache
110+
public
111+
# Cache will not be used by Gatsby if the following files change:
112+
# https://www.gatsbyjs.com/docs/build-caching/
113+
key: pr-gatsby-${{ hashFiles('package.json', 'gatsby-config.js', 'gatsby-node.js') }}
114+
101115
- name: Build
102116
run: npm run build
103117

0 commit comments

Comments
 (0)