Skip to content

Commit

Permalink
delete cache if exists
Browse files Browse the repository at this point in the history
  • Loading branch information
dskvr committed Jan 18, 2024
1 parent f37498e commit f895c1b
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,27 @@ on:
jobs:
publish:
runs-on: ubuntu-latest
env:
cache-key: nostr-geotags-docs
permissions:
contents: write
steps:
- name: Restore Cache
id: cache-exists
uses: actions/cache/restore@v3
with:
path: ./cache
key: ${{ env.cache-key }}

- name: Delete Previous Cache
if: ${{ steps.cache-restore.outputs.cache-hit }}
continue-on-error: true
run: |
gh extension install actions/gh-actions-cache
gh actions-cache delete "${{ env.cache-key }}" --confirm
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- uses: actions/checkout@v3

- name: Set up Node.js
Expand All @@ -38,7 +56,7 @@ jobs:
uses: actions/cache/save@v3
with:
path: docs
key: nostr-geotags-docs
key: ${{ env.cache-key }}

- name: Change branch
run: git fetch --all && git checkout gh-pages
Expand All @@ -51,7 +69,7 @@ jobs:
id: cache-restore
with:
path: docs
key: nostr-geotags-docs
key: ${{ env.cache-key }}
fail-on-cache-miss: true

- name: Configure Git
Expand Down

0 comments on commit f895c1b

Please sign in to comment.