Content-Length: 396931 | pFad | http://github.com/npm/documentation/commit/dffba56cc92a389d4f9da493da9ade49f89029d3

EA chore: cache gatsby builds between workflow runs (#746) · npm/documentation@dffba56 · GitHub
Skip to content

Commit dffba56

Browse files
authored
chore: cache gatsby builds between workflow runs (#746)
1 parent c5022b2 commit dffba56

File tree

3 files changed

+46
-1
lines changed

3 files changed

+46
-1
lines changed

.github/workflows/publish.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,34 @@ jobs:
8484
run: npm -v
8585
- name: Install Dependencies
8686
run: npm i --no-audit --no-fund
87+
- name: Rebuild deps
88+
run: npm rebuild
89+
8790
- name: Setup Pages
8891
uses: actions/configure-pages@v1
92+
93+
- name: Restore cache
94+
id: cache-gatsby
95+
uses: actions/cache/restore@v3
96+
with:
97+
key: ${{ runner.os }}-gatsby-${{ github.ref_name }}
98+
path: |
99+
public
100+
.cache
101+
89102
- name: Build documentation
90103
run: npm run build
91104
env:
92105
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
106+
107+
- name: Save cache
108+
uses: actions/cache/save@v3
109+
with:
110+
key: ${{ steps.cache-gatsby.outputs.cache-primary-key }}
111+
path: |
112+
public
113+
.cache
114+
93115
- name: Upload artifact
94116
uses: actions/upload-pages-artifact@v1
95117
with:

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"private": true,
99
"scripts": {
1010
"develop": "gatsby develop",
11-
"build": "NODE_OPTIONS=--max-old-space-size=7168 gatsby build",
11+
"build": "NODE_OPTIONS=--max-old-space-size=7168 gatsby build --verbose --log-pages",
12+
"clean": "rm -rf .cache/ public/",
1213
"serve": "gatsby serve",
1314
"lint": "eslint \"**/*.js\"",
1415
"postlint": "template-oss-check",

scripts/template-oss/publish.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,34 @@ jobs:
2323
shell: bash
2424
steps:
2525
{{> stepsSetup }}
26+
- name: Rebuild deps
27+
run: npm rebuild
28+
2629
- name: Setup Pages
2730
uses: actions/configure-pages@v1
31+
32+
- name: Restore cache
33+
id: cache-gatsby
34+
uses: actions/cache/restore@v3
35+
with:
36+
key: $\{{ runner.os }}-gatsby-$\{{ github.ref_name }}
37+
path: |
38+
public
39+
.cache
40+
2841
- name: Build documentation
2942
run: npm run build
3043
env:
3144
GITHUB_TOKEN: $\{{ secrets.GITHUB_TOKEN }}
45+
46+
- name: Save cache
47+
uses: actions/cache/save@v3
48+
with:
49+
key: $\{{ steps.cache-gatsby.outputs.cache-primary-key }}
50+
path: |
51+
public
52+
.cache
53+
3254
- name: Upload artifact
3355
uses: actions/upload-pages-artifact@v1
3456
with:

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/npm/documentation/commit/dffba56cc92a389d4f9da493da9ade49f89029d3

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy