|
63 | 63 | with:
|
64 | 64 | path: |
|
65 | 65 | .docusaurus
|
66 |
| - build |
67 |
| - key: ${{ runner.os }}-docusaurus-build-${{ hashFiles('src/**', 'docs/**', 'blog/**', 'docusaurus.config.js', 'sidebars.js', 'package-lock.json') }} |
| 66 | + key: ${{ runner.os }}-docusaurus-${{ hashFiles('src/**', 'docs/**', 'blog/**', 'docusaurus.config.js', 'sidebars.js') }} |
68 | 67 | restore-keys: |
|
69 |
| - ${{ runner.os }}-docusaurus-build- |
| 68 | + ${{ runner.os }}-docusaurus- |
70 | 69 |
|
71 | 70 | - name: Cache webpack
|
72 | 71 | uses: actions/cache@v3
|
|
137 | 136 | --expiry $end_date \
|
138 | 137 | --output tsv)
|
139 | 138 |
|
140 |
| - # Create comprehensive content type mapping file for azcopy |
141 |
| - cat > content-type-map.json << EOF |
142 |
| - { |
143 |
| - "*.css": "text/css", |
144 |
| - "*.js": "application/javascript", |
145 |
| - "*.mjs": "application/javascript", |
146 |
| - "*.json": "application/json", |
147 |
| - "*.html": "text/html", |
148 |
| - "*.htm": "text/html", |
149 |
| - "*.xml": "application/xml", |
150 |
| - "*.txt": "text/plain", |
151 |
| - "*.md": "text/markdown", |
152 |
| -
|
153 |
| - "*.png": "image/png", |
154 |
| - "*.jpg": "image/jpeg", |
155 |
| - "*.jpeg": "image/jpeg", |
156 |
| - "*.gif": "image/gif", |
157 |
| - "*.webp": "image/webp", |
158 |
| - "*.avif": "image/avif", |
159 |
| - "*.svg": "image/svg+xml", |
160 |
| - "*.bmp": "image/bmp", |
161 |
| - "*.tiff": "image/tiff", |
162 |
| - "*.ico": "image/x-icon", |
163 |
| -
|
164 |
| - "*.woff": "font/woff", |
165 |
| - "*.woff2": "font/woff2", |
166 |
| - "*.ttf": "font/ttf", |
167 |
| - "*.otf": "font/otf", |
168 |
| - "*.eot": "application/vnd.ms-fontobject", |
169 |
| -
|
170 |
| - "*.pdf": "application/pdf", |
171 |
| - "*.doc": "application/msword", |
172 |
| - "*.docx": "application/vnd.openxmlformats-officedocument.wordprocessingml.document", |
173 |
| - "*.xls": "application/vnd.ms-excel", |
174 |
| - "*.xlsx": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", |
175 |
| - "*.ppt": "application/vnd.ms-powerpoint", |
176 |
| - "*.pptx": "application/vnd.openxmlformats-officedocument.presentationml.presentation", |
177 |
| - "*.odt": "application/vnd.oasis.opendocument.text", |
178 |
| - "*.ods": "application/vnd.oasis.opendocument.spreadsheet", |
179 |
| - "*.odp": "application/vnd.oasis.opendocument.presentation", |
180 |
| -
|
181 |
| - "*.zip": "application/zip", |
182 |
| - "*.rar": "application/vnd.rar", |
183 |
| - "*.7z": "application/x-7z-compressed", |
184 |
| - "*.tar": "application/x-tar", |
185 |
| - "*.gz": "application/gzip", |
186 |
| - "*.bz2": "application/x-bzip2", |
187 |
| -
|
188 |
| - "*.mp4": "video/mp4", |
189 |
| - "*.webm": "video/webm", |
190 |
| - "*.avi": "video/x-msvideo", |
191 |
| - "*.mov": "video/quicktime", |
192 |
| - "*.wmv": "video/x-ms-wmv", |
193 |
| -
|
194 |
| - "*.mp3": "audio/mpeg", |
195 |
| - "*.wav": "audio/wav", |
196 |
| - "*.ogg": "audio/ogg", |
197 |
| - "*.m4a": "audio/mp4", |
198 |
| -
|
199 |
| - "*.csv": "text/csv", |
200 |
| - "*.rtf": "application/rtf", |
201 |
| - "*.epub": "application/epub+zip", |
202 |
| - "*.mobi": "application/x-mobipocket-ebook" |
203 |
| - } |
204 |
| - EOF |
205 |
| -
|
206 |
| - # Use azcopy sync with comprehensive content type mapping |
| 139 | + # Use azcopy sync without content type mapping (will be set in fallback step) |
207 | 140 | azcopy sync "./build/" \
|
208 | 141 | "https://${{ secrets.STORAGE_ACCOUNT_NAME }}.blob.core.windows.net/\$web?$sas_token" \
|
209 | 142 | --delete-destination=true \
|
210 | 143 | --compare-hash=MD5 \
|
211 | 144 | --log-level=INFO \
|
212 | 145 | --cap-mbps=0 \
|
213 |
| - --block-size-mb=4 \ |
214 |
| - --content-type-map="content-type-map.json" |
| 146 | + --block-size-mb=4 |
215 | 147 |
|
216 | 148 | echo "Sync completed with comprehensive MIME types!"
|
217 | 149 |
|
218 |
| - - name: Fallback MIME type setting for critical files |
| 150 | + - name: Set MIME types for all file types |
219 | 151 | run: |
|
220 |
| - echo "Setting MIME types for critical files as fallback (in case azcopy mapping failed)..." |
| 152 | + echo "Setting MIME types for all file types..." |
221 | 153 |
|
222 | 154 | # Install Azure CLI if not available
|
223 | 155 | if ! command -v az &> /dev/null; then
|
224 | 156 | curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
|
225 | 157 | fi
|
226 | 158 |
|
227 |
| - # Set MIME types for most critical files (CSS and JS) that affect styling |
228 |
| - echo "Ensuring CSS files have correct MIME type..." |
229 |
| - az storage blob update-batch \ |
230 |
| - --account-name ${{ secrets.STORAGE_ACCOUNT_NAME }} \ |
231 |
| - --account-key ${{ secrets.STORAGE_ACCOUNT_KEY }} \ |
232 |
| - --source '$web' \ |
233 |
| - --pattern "*.css" \ |
234 |
| - --content-type "text/css" \ |
235 |
| - --if-unmodified-since "1970-01-01T00:00:00Z" \ |
236 |
| - --no-progress || echo "CSS MIME type update completed (some files may have been skipped)" |
237 |
| -
|
238 |
| - echo "Ensuring JS files have correct MIME type..." |
239 |
| - az storage blob update-batch \ |
240 |
| - --account-name ${{ secrets.STORAGE_ACCOUNT_NAME }} \ |
241 |
| - --account-key ${{ secrets.STORAGE_ACCOUNT_KEY }} \ |
242 |
| - --source '$web' \ |
243 |
| - --pattern "*.js" \ |
244 |
| - --content-type "application/javascript" \ |
245 |
| - --if-unmodified-since "1970-01-01T00:00:00Z" \ |
246 |
| - --no-progress || echo "JS MIME type update completed (some files may have been skipped)" |
247 |
| -
|
248 |
| - echo "Critical MIME types verified!" |
| 159 | + # Web files |
| 160 | + echo "Setting MIME types for web files..." |
| 161 | + az storage blob update-batch --account-name ${{ secrets.STORAGE_ACCOUNT_NAME }} --account-key ${{ secrets.STORAGE_ACCOUNT_KEY }} --source '$web' --pattern "*.css" --content-type "text/css" --if-unmodified-since "1970-01-01T00:00:00Z" --no-progress || true |
| 162 | + az storage blob update-batch --account-name ${{ secrets.STORAGE_ACCOUNT_NAME }} --account-key ${{ secrets.STORAGE_ACCOUNT_KEY }} --source '$web' --pattern "*.js" --content-type "application/javascript" --if-unmodified-since "1970-01-01T00:00:00Z" --no-progress || true |
| 163 | + az storage blob update-batch --account-name ${{ secrets.STORAGE_ACCOUNT_NAME }} --account-key ${{ secrets.STORAGE_ACCOUNT_KEY }} --source '$web' --pattern "*.mjs" --content-type "application/javascript" --if-unmodified-since "1970-01-01T00:00:00Z" --no-progress || true |
| 164 | + az storage blob update-batch --account-name ${{ secrets.STORAGE_ACCOUNT_NAME }} --account-key ${{ secrets.STORAGE_ACCOUNT_KEY }} --source '$web' --pattern "*.json" --content-type "application/json" --if-unmodified-since "1970-01-01T00:00:00Z" --no-progress || true |
| 165 | + az storage blob update-batch --account-name ${{ secrets.STORAGE_ACCOUNT_NAME }} --account-key ${{ secrets.STORAGE_ACCOUNT_KEY }} --source '$web' --pattern "*.html" --content-type "text/html" --if-unmodified-since "1970-01-01T00:00:00Z" --no-progress || true |
| 166 | + az storage blob update-batch --account-name ${{ secrets.STORAGE_ACCOUNT_NAME }} --account-key ${{ secrets.STORAGE_ACCOUNT_KEY }} --source '$web' --pattern "*.htm" --content-type "text/html" --if-unmodified-since "1970-01-01T00:00:00Z" --no-progress || true |
| 167 | + az storage blob update-batch --account-name ${{ secrets.STORAGE_ACCOUNT_NAME }} --account-key ${{ secrets.STORAGE_ACCOUNT_KEY }} --source '$web' --pattern "*.xml" --content-type "application/xml" --if-unmodified-since "1970-01-01T00:00:00Z" --no-progress || true |
| 168 | + az storage blob update-batch --account-name ${{ secrets.STORAGE_ACCOUNT_NAME }} --account-key ${{ secrets.STORAGE_ACCOUNT_KEY }} --source '$web' --pattern "*.txt" --content-type "text/plain" --if-unmodified-since "1970-01-01T00:00:00Z" --no-progress || true |
| 169 | +
|
| 170 | + # Images |
| 171 | + echo "Setting MIME types for images..." |
| 172 | + az storage blob update-batch --account-name ${{ secrets.STORAGE_ACCOUNT_NAME }} --account-key ${{ secrets.STORAGE_ACCOUNT_KEY }} --source '$web' --pattern "*.png" --content-type "image/png" --if-unmodified-since "1970-01-01T00:00:00Z" --no-progress || true |
| 173 | + az storage blob update-batch --account-name ${{ secrets.STORAGE_ACCOUNT_NAME }} --account-key ${{ secrets.STORAGE_ACCOUNT_KEY }} --source '$web' --pattern "*.jpg" --content-type "image/jpeg" --if-unmodified-since "1970-01-01T00:00:00Z" --no-progress || true |
| 174 | + az storage blob update-batch --account-name ${{ secrets.STORAGE_ACCOUNT_NAME }} --account-key ${{ secrets.STORAGE_ACCOUNT_KEY }} --source '$web' --pattern "*.jpeg" --content-type "image/jpeg" --if-unmodified-since "1970-01-01T00:00:00Z" --no-progress || true |
| 175 | + az storage blob update-batch --account-name ${{ secrets.STORAGE_ACCOUNT_NAME }} --account-key ${{ secrets.STORAGE_ACCOUNT_KEY }} --source '$web' --pattern "*.gif" --content-type "image/gif" --if-unmodified-since "1970-01-01T00:00:00Z" --no-progress || true |
| 176 | + az storage blob update-batch --account-name ${{ secrets.STORAGE_ACCOUNT_NAME }} --account-key ${{ secrets.STORAGE_ACCOUNT_KEY }} --source '$web' --pattern "*.webp" --content-type "image/webp" --if-unmodified-since "1970-01-01T00:00:00Z" --no-progress || true |
| 177 | + az storage blob update-batch --account-name ${{ secrets.STORAGE_ACCOUNT_NAME }} --account-key ${{ secrets.STORAGE_ACCOUNT_KEY }} --source '$web' --pattern "*.svg" --content-type "image/svg+xml" --if-unmodified-since "1970-01-01T00:00:00Z" --no-progress || true |
| 178 | + az storage blob update-batch --account-name ${{ secrets.STORAGE_ACCOUNT_NAME }} --account-key ${{ secrets.STORAGE_ACCOUNT_KEY }} --source '$web' --pattern "*.ico" --content-type "image/x-icon" --if-unmodified-since "1970-01-01T00:00:00Z" --no-progress || true |
| 179 | +
|
| 180 | + # Fonts |
| 181 | + echo "Setting MIME types for fonts..." |
| 182 | + az storage blob update-batch --account-name ${{ secrets.STORAGE_ACCOUNT_NAME }} --account-key ${{ secrets.STORAGE_ACCOUNT_KEY }} --source '$web' --pattern "*.woff" --content-type "font/woff" --if-unmodified-since "1970-01-01T00:00:00Z" --no-progress || true |
| 183 | + az storage blob update-batch --account-name ${{ secrets.STORAGE_ACCOUNT_NAME }} --account-key ${{ secrets.STORAGE_ACCOUNT_KEY }} --source '$web' --pattern "*.woff2" --content-type "font/woff2" --if-unmodified-since "1970-01-01T00:00:00Z" --no-progress || true |
| 184 | + az storage blob update-batch --account-name ${{ secrets.STORAGE_ACCOUNT_NAME }} --account-key ${{ secrets.STORAGE_ACCOUNT_KEY }} --source '$web' --pattern "*.ttf" --content-type "font/ttf" --if-unmodified-since "1970-01-01T00:00:00Z" --no-progress || true |
| 185 | + az storage blob update-batch --account-name ${{ secrets.STORAGE_ACCOUNT_NAME }} --account-key ${{ secrets.STORAGE_ACCOUNT_KEY }} --source '$web' --pattern "*.otf" --content-type "font/otf" --if-unmodified-since "1970-01-01T00:00:00Z" --no-progress || true |
| 186 | +
|
| 187 | + echo "All MIME types set successfully!" |
249 | 188 |
|
250 | 189 | - name: Purge CDN endpoint (if configured)
|
251 | 190 | run: |
|
|
0 commit comments