Skip to content

Commit

Permalink
ci: Try to implement caching to sub-parts of site
Browse files Browse the repository at this point in the history
  • Loading branch information
ribose-jeffreylau committed Feb 5, 2025
1 parent fa95243 commit de0cc0d
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/build_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,23 @@ jobs:
with:
submodules: 'recursive'
depth: 1
- name: Calculate cache key
id: cache-key
run: |
echo "::set-output name=cache-key::$(scripts/metacacher metanorma metanorma-admin.yml)"
- name: Restore cache
id: cache
uses: actions/cache@v4
with:
path: _site/administrative
key: ${{ steps.cache-key.outputs.cache-key }}
- name: Use Ruby
if: steps.cache.outputs.cache-hit != 'true'
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Build site
if: steps.cache.outputs.cache-hit != 'true'
run: |
make build-admin
- name: Save artifacts
Expand All @@ -61,11 +73,23 @@ jobs:
with:
submodules: 'recursive'
depth: 1
- name: Calculate cache key
id: cache-key
run: |
echo "::set-output name=cache-key::$(scripts/metacacher metanorma metanorma-standards.yml)"
- name: Restore cache
id: cache
uses: actions/cache@v4
with:
path: _site/standards
key: ${{ steps.cache-key.outputs.cache-key }}
- name: Use Ruby
if: steps.cache.outputs.cache-hit != 'true'
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Build site
if: steps.cache.outputs.cache-hit != 'true'
run: |
make build-standards
- name: Save artifacts
Expand All @@ -82,13 +106,25 @@ jobs:
with:
submodules: 'recursive'
depth: 1
- name: Calculate cache key
id: cache-key
run: |
echo "::set-output name=cache-key::$(scripts/metacacher jekyll _config.yml)"
- name: Restore cache
id: cache
uses: actions/cache@v4
with:
path: _site
key: ${{ steps.cache-key.outputs.cache-key }}
- name: Use Ruby
if: steps.cache.outputs.cache-hit != 'true'
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
env:
JEKYLL: 1
- name: Build site
if: steps.cache.outputs.cache-hit != 'true'
run: |
make _site
- name: Save artifacts
Expand Down

0 comments on commit de0cc0d

Please sign in to comment.