Skip to content

Commit

Permalink
Merge pull request #61 from svengo/svengo-patch-1
Browse files Browse the repository at this point in the history
Update publish-docker.yml
  • Loading branch information
svengo authored May 19, 2024
2 parents 59c7280 + cba106f commit 7093e9d
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/cleanup-cache.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Cleanup build cache

on:
workflow_dispatch:

jobs:
cleanup:
runs-on: ubuntu-latest
steps:
- name: Cleanup
run: |
gh extension install actions/gh-actions-cache
echo "Fetching list of cache key"
cacheKeysForPR=$(gh actions-cache list -R $REPO -L 100 | cut -f 1 )
## Setting this to not fail the workflow while deleting cache keys.
set +e
echo "Deleting caches..."
gh cache delete --all
for cacheKey in $cacheKeysForPR
do
gh actions-cache delete $cacheKey -R $REPO --confirm
done
echo "Done"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
BRANCH: refs/pull/${{ github.event.pull_request.number }}/merge

1 change: 1 addition & 0 deletions .github/workflows/publish-docker.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Build and Publish Docker Image

on:
workflow_dispatch:
push:
branches:
- main
Expand Down

0 comments on commit 7093e9d

Please sign in to comment.