Skip to content

Commit

Permalink
Add caching to docs-build
Browse files Browse the repository at this point in the history
Closes gh-40104
  • Loading branch information
philwebb committed Mar 30, 2024
1 parent 669a1ee commit 67277f4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 20
- name: Check Out 'package.json' From Main
run: node run.js --only-checkout
- name: Cache Files
uses: actions/cache@v4
with:
key: antora-${{ hashFiles('package-lock.json', 'antora-playbook.yml') }}
path: |
~/.npm
~/.cache/antora
- name: Install and Run Antora
env:
ALGOLIA_APP_ID: 244V8V9FGG
Expand All @@ -37,7 +46,7 @@ jobs:
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
REFERENCE: ${{ github.event.inputs.build-refname }}
BUILD_VERSION: ${{ github.event.inputs.build-version }}
run: node run.js
run: node run.js --no-checkout
- name: Sync Documentation
uses: spring-io/spring-doc-actions/rsync-antora-reference@v0.0.15
with:
Expand Down
6 changes: 4 additions & 2 deletions run.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
async function main() {
try {
checkout(process.argv.includes('--no-checkout'))
install(process.argv.includes('--no-install'))
run(process.argv.includes('--no-run'))
if (!process.argv.includes('--only-checkout')) {
install(process.argv.includes('--no-install'))
run(process.argv.includes('--no-run'))
}
} catch (error) {
console.log("Unexpected error")
process.exitCode = (error.exitCode) ? error.exitCode : 1
Expand Down

0 comments on commit 67277f4

Please sign in to comment.