Commit 28c84e5
authored
ci: set cache headers and remove deploy downtime for storybook publish (#5206)
* ci: set cache headers and remove deploy downtime for storybook publish
Storybook prod served every file with Front Door's default
cache-control (public, max-age=172800), including index.html and the
un-hashed sb-manager/sb-addons bundles. After each deploy, browsers
with a warm cache mixed bundles from two deploys and crashed the
Manager UI (api.getNavAvailability is not a function).
- Upload content-hashed assets/ with max-age=31536000, immutable
- Upload everything else with no-cache so browsers revalidate
(cheap 304s via ETag/Last-Modified)
- Replace delete-all-before-upload with overwrite-then-delete-stale,
removing the downtime window on every deploy; new hashed assets are
uploaded before index.html so it never references missing chunks
* ci: delete stale storybook blobs by name set instead of timestamp
Comparing blob lastModified (Azure server clock) against a runner-clock
timestamp could delete freshly uploaded blobs under clock skew. Capture
the deployed file set before upload and delete container blobs not in
that set — deterministic, no timestamps, no locale-sensitive string
comparison.
* ci: guard empty deploy set and parallelise stale blob deletion
An empty deployed-blobs list would classify every blob in the container
as stale and wipe the live site — refuse to run cleanup on an empty
set. Content-hashed assets are renamed on every deploy, so the whole
previous assets/* set is deleted each run; parallelise with xargs -P 8
instead of one sequential az call per blob.
* ci: make stale blob cleanup best-effort
A single transient az delete failure made xargs exit 123 and failed
the job under set -e, even though the new content is already live.
Capture the exit code and warn instead — surviving orphans are
re-detected as stale on the next deploy.
* ci: document container ownership assumption in storybook cleanup1 parent d16014f commit 28c84e5
1 file changed
Lines changed: 80 additions & 33 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | 104 | | |
137 | 105 | | |
138 | 106 | | |
| |||
150 | 118 | | |
151 | 119 | | |
152 | 120 | | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
153 | 147 | | |
154 | 148 | | |
155 | 149 | | |
| 150 | + | |
156 | 151 | | |
157 | 152 | | |
158 | 153 | | |
159 | 154 | | |
160 | 155 | | |
161 | 156 | | |
| 157 | + | |
162 | 158 | | |
163 | 159 | | |
164 | 160 | | |
165 | 161 | | |
166 | | - | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
167 | 214 | | |
168 | 215 | | |
169 | 216 | | |
| |||
0 commit comments