Skip to content

Commit

Permalink
CI/CD: Separate asset and http cache
Browse files Browse the repository at this point in the history
  • Loading branch information
deathaxe committed Dec 2, 2023
1 parent 8fa7e44 commit 74d5a55
Showing 1 changed file with 29 additions and 20 deletions.
49 changes: 29 additions & 20 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,21 @@ jobs:
id: checkout-repository
uses: actions/checkout@v4

- name: Restore cache
id: restore-cache
- name: Restore http cache
id: restore-http-cache
uses: actions/cache/restore@v3
with:
path: |-
cache/
_site/libraries.json.sha512
blacklist.json
key: ${{ runner.os }}-state
restore-keys: |
${{ runner.os }}-state
path: cache/
key: http-cache
restore-keys: http-cache

- name: Restore asset cache
id: restore-asset-cache
uses: actions/cache/restore@v3
with:
path: _site/channel_v4.json.sha512
key: asset-cache
restore-keys: asset-cache

- name: Resolve repository
id: resolve-repository
Expand All @@ -49,17 +53,6 @@ jobs:
GH_PASS: ${{secrets.GH_APP_TOKEN}}
run: python3 tasks crawl

- name: Save cache
id: save-cache
uses: actions/cache/save@v3
if: always()
with:
path: |-
cache/
_site/libraries.json.sha512
blacklist.json
key: ${{ runner.os }}-state-${{ hashFiles('cache/*') }}

- name: Setup pages
id: setup-pages
if: steps.resolve-repository.outputs.updated == 'true'
Expand All @@ -72,6 +65,22 @@ jobs:
with:
path: _site/

- name: Save http cache
id: save-http-cache
uses: actions/cache/save@v3
if: always()
with:
path: cache/
key: http-cache-${{ hashFiles('cache/*') }}

- name: Save asset cache
id: save-asset-cache
uses: actions/cache/save@v3
if: always()
with:
path: _site/channel_v4.json.sha512
key: asset-cache-${{ hashFiles('_site/channel_v4.json.sha512') }}

deploy:
needs: build
if: needs.build.outputs.updated == 'true'
Expand Down

0 comments on commit 74d5a55

Please sign in to comment.