Skip to content

Commit

Permalink
Cache Handling
Browse files Browse the repository at this point in the history
  • Loading branch information
deathaxe committed Nov 24, 2023
1 parent 01e8a9d commit a27a865
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 18 deletions.
20 changes: 3 additions & 17 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,12 @@ jobs:
id: checkout-repository
uses: actions/checkout@v4

- name: Restore cache
- name: Cache state
id: restore-cache
uses: actions/cache/restore@v3
with:
path: |-
cache/
_site/libraries.json.sha512
blacklist.json
key: ${{ runner.os }}-state
path: cache
key: ${{ runner.os }}-state-${{ hashFiles('cache/*') }}
restore-keys: |
${{ runner.os }}-state
Expand All @@ -49,17 +46,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 Down
2 changes: 1 addition & 1 deletion tasks/crawl.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def store_asset(filename, content):
new_filename_bz2 = filename + '.bz2-new'
filename_gz = filename + '.gz'
filename_bz2 = filename + '.bz2'
filename_sha512 = filename + '.sha512'
filename_sha512 = Path(sys_path.pc_cache_dir()) / (Path(filename).name + '.sha512')

encoded_content = content.encode('utf-8')
content_hash = hashlib.sha512(encoded_content).hexdigest().encode('utf-8')
Expand Down

0 comments on commit a27a865

Please sign in to comment.