Skip to content

Commit

Permalink
feat: add clean-cache workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
bigint committed May 21, 2023
1 parent 536eeaa commit f0749e1
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
32 changes: 32 additions & 0 deletions .github/workflows/clean-cache.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Clean cache

on:
workflow_dispatch:

jobs:
cleanup:
name: Cleanup
runs-on: ubuntu-latest
steps:
- name: Checkout 🚪
uses: actions/checkout@v3

- name: Cleanup ✨
run: |
gh extension install actions/gh-actions-cache
REPO=${{ github.repository }}
echo "Fetching list of cache key"
cacheKeysForPR=$(gh actions-cache list -R $REPO | cut -f 1 )
## Setting this to not fail the workflow while deleting cache keys.
set +e
echo "Deleting caches..."
for cacheKey in $cacheKeysForPR
do
gh actions-cache delete $cacheKey -R $REPO --confirm
done
echo "Done"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion tests/constants.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const isNightly = true;
export const isNightly = process.env.NIGHTLY === 'true';
export const WEB_BASE_URL = isNightly
? 'https://lenster.xyz'
: 'http://localhost:4783';
Expand Down

0 comments on commit f0749e1

Please sign in to comment.