Skip to content

Commit 94a000e

Browse files
committed
Add manual workflow for flushing CI cache
1 parent f90d541 commit 94a000e

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

.github/workflows/flush-cache.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Based on https://github.com/actions/cache/issues/2#issuecomment-1098723830
2+
# This seems to be the only way to flush GitHub Actions cache without changing
3+
# the cache key every time.
4+
on:
5+
workflow_dispatch:
6+
pull_request: # temporary, remove before merging if this works
7+
jobs:
8+
flush-cache:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/cache@v2
12+
with:
13+
path: /tmp/flush
14+
key: ${{ github.run_id }}-${{ github.run_attempt }}
15+
# 10 GB is the max cache size. Anything over that will be evicted.
16+
# We go 50% over the limit for good measure.
17+
# Data is zstd-compressed, so we can't fallocate it.
18+
- run: dd if=/dev/urandom of=/tmp/flush bs=1M count=15000

0 commit comments

Comments
 (0)