Skip to content

Commit 67277f4

Browse files
committed
Add caching to docs-build
Closes gh-40104
1 parent 669a1ee commit 67277f4

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

.github/workflows/deploy-docs.yml

+10-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,15 @@ jobs:
2828
uses: actions/setup-node@v4
2929
with:
3030
node-version: 20
31+
- name: Check Out 'package.json' From Main
32+
run: node run.js --only-checkout
33+
- name: Cache Files
34+
uses: actions/cache@v4
35+
with:
36+
key: antora-${{ hashFiles('package-lock.json', 'antora-playbook.yml') }}
37+
path: |
38+
~/.npm
39+
~/.cache/antora
3140
- name: Install and Run Antora
3241
env:
3342
ALGOLIA_APP_ID: 244V8V9FGG
@@ -37,7 +46,7 @@ jobs:
3746
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
3847
REFERENCE: ${{ github.event.inputs.build-refname }}
3948
BUILD_VERSION: ${{ github.event.inputs.build-version }}
40-
run: node run.js
49+
run: node run.js --no-checkout
4150
- name: Sync Documentation
4251
uses: spring-io/spring-doc-actions/[email protected]
4352
with:

run.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@
77
async function main() {
88
try {
99
checkout(process.argv.includes('--no-checkout'))
10-
install(process.argv.includes('--no-install'))
11-
run(process.argv.includes('--no-run'))
10+
if (!process.argv.includes('--only-checkout')) {
11+
install(process.argv.includes('--no-install'))
12+
run(process.argv.includes('--no-run'))
13+
}
1214
} catch (error) {
1315
console.log("Unexpected error")
1416
process.exitCode = (error.exitCode) ? error.exitCode : 1

0 commit comments

Comments
 (0)