Skip to content

Commit a491c4a

Browse files
pirateclaude
andcommitted
CI: don't let cached pirate.html overwrite the committed one
The 'Restore deployed dashboards' actions/cache step runs after checkout and replaces cloudflare/public/*.html with whatever was in the previous run's cache. That meant a freshly-committed pirate.html (or index/404) would silently lose to a stale cached copy, with no error. Two-part fix: - Exclude the committed dashboards from the cache path (! patterns), so future cache saves don't re-store them. - After the restore, force git checkout of the three committed dashboards, which handles the existing cache (which still has the stale copies) and any future drift. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 373f233 commit a491c4a

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

.github/workflows/mine-and-deploy.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,31 @@ jobs:
6060
# replaces the assets dir on deploy. Single shared key — every run
6161
# restores the latest snapshot of all deployed dashboards, adds /
6262
# refreshes its own user(s), and writes back the full set.
63+
#
64+
# Exclude committed dashboards (pirate, index, 404) from the cache
65+
# so old versions can't overwrite the just-checked-out repo files
66+
# when this step restores. We also explicitly re-apply them from
67+
# git after the restore (next step) — defends against the case
68+
# where the existing cache still contains them from a previous run.
6369
- name: Restore deployed dashboards
6470
uses: actions/cache@v4
6571
with:
6672
path: |
6773
cloudflare/public/*.html
74+
!cloudflare/public/pirate.html
75+
!cloudflare/public/index.html
76+
!cloudflare/public/404.html
6877
key: deployed-htmls-v1-${{ github.run_id }}
6978
restore-keys: |
7079
deployed-htmls-v1-
7180
81+
- name: Re-apply committed dashboards from git
82+
run: |
83+
git checkout HEAD -- \
84+
cloudflare/public/pirate.html \
85+
cloudflare/public/index.html \
86+
cloudflare/public/404.html
87+
7288
- name: Install gh CLI
7389
run: |
7490
type -p gh >/dev/null || (

0 commit comments

Comments
 (0)