Skip to content

Commit

Permalink
ci(build-docs): Restore GHA-level caching
Browse files Browse the repository at this point in the history
  • Loading branch information
ribose-jeffreylau committed Feb 17, 2025
1 parent b423f7f commit 2af3d88
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion .github/workflows/build_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,18 @@ jobs:
with:
submodules: 'recursive'
fetch-depth: 1

- name: Calculate cache key
id: cache-key
run: |
echo "cache-key=$(scripts/metacachekey metanorma src-documents/metanorma-${{ matrix.doc_type }}.yml)" >> $GITHUB_OUTPUT
- name: Restore cache
id: cache
uses: actions/cache@v4
with:
path: _site/${{ matrix.doc_type }}
key: ${{ steps.cache-key.outputs.cache-key }}
- name: Metanorma generate site
if: steps.cache.outputs.cache-hit != 'true'
uses: actions-mn/build-and-publish@main
with:
destination: artifact
Expand All @@ -94,6 +104,12 @@ jobs:
artifact-name: metanorma-docs-${{ matrix.doc_type }}
source-path: ./
config-file: src-documents/metanorma-${{ matrix.doc_type }}.yml
- name: Save artifacts
if: steps.cache.outputs.cache-hit == 'true'
uses: actions/upload-artifact@v4
with:
name: metanorma-docs-${{ matrix.doc_type }}
path: _site/${{ matrix.doc_type }}

#
# At the very end, integrate them all with Jekyll.
Expand Down

0 comments on commit 2af3d88

Please sign in to comment.