Skip to content

Commit 0e992ce

Browse files
authored
Update main_product-docs-prod.yml
1 parent 1873075 commit 0e992ce

File tree

1 file changed

+11
-56
lines changed

1 file changed

+11
-56
lines changed

.github/workflows/main_product-docs-prod.yml

Lines changed: 11 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -155,65 +155,20 @@ jobs:
155155
run: |
156156
echo "Setting content types for web files..."
157157
158-
# Create a properties file for batch operations
159-
cat > set_content_types.sh << 'EOF'
160-
#!/bin/bash
158+
# For 60,000 files, we should skip individual content type updates
159+
# and rely on Azure Static Website to serve files with correct types
160+
echo "With 60,000+ files, setting individual content types would take too long."
161+
echo "Azure Static Website automatically serves files with appropriate content types based on file extensions."
161162
162-
# Function to set content types in parallel
163-
set_content_type() {
164-
local pattern=$1
165-
local content_type=$2
166-
167-
az storage blob list \
168-
--account-name ${{ secrets.STORAGE_ACCOUNT_NAME }} \
169-
--account-key ${{ secrets.STORAGE_ACCOUNT_KEY }} \
170-
--container-name '$web' \
171-
--prefix "" \
172-
--query "[?ends_with(name, '$pattern')].name" \
173-
--output tsv | \
174-
xargs -P 10 -I {} az storage blob update \
175-
--account-name ${{ secrets.STORAGE_ACCOUNT_NAME }} \
176-
--account-key ${{ secrets.STORAGE_ACCOUNT_KEY }} \
177-
--container-name '$web' \
178-
--name "{}" \
179-
--content-type "$content_type" \
180-
--output none
181-
}
163+
# Alternatively, set content types during upload with azcopy
164+
# by using a mapping file (much more efficient)
182165
183-
# Set content types in parallel (10 concurrent operations)
184-
echo "Setting HTML content types..."
185-
set_content_type ".html" "text/html"
166+
# If you absolutely need to set custom content types, consider:
167+
# 1. Setting them during the build process
168+
# 2. Using Azure CDN rules to set content types
169+
# 3. Using a separate script that runs less frequently
186170
187-
echo "Setting CSS content types..."
188-
set_content_type ".css" "text/css"
189-
190-
echo "Setting JS content types..."
191-
set_content_type ".js" "application/javascript"
192-
193-
echo "Setting JSON content types..."
194-
set_content_type ".json" "application/json"
195-
196-
echo "Setting SVG content types..."
197-
set_content_type ".svg" "image/svg+xml"
198-
199-
echo "Setting image content types..."
200-
set_content_type ".png" "image/png"
201-
set_content_type ".jpg" "image/jpeg"
202-
set_content_type ".jpeg" "image/jpeg"
203-
set_content_type ".gif" "image/gif"
204-
set_content_type ".webp" "image/webp"
205-
206-
echo "Setting font content types..."
207-
set_content_type ".woff" "font/woff"
208-
set_content_type ".woff2" "font/woff2"
209-
set_content_type ".ttf" "font/ttf"
210-
set_content_type ".eot" "application/vnd.ms-fontobject"
211-
212-
echo "Content types updated!"
213-
EOF
214-
215-
chmod +x set_content_types.sh
216-
./set_content_types.sh
171+
echo "Content type handling delegated to Azure Static Website defaults."
217172
218173
- name: Purge CDN endpoint (if configured)
219174
run: |

0 commit comments

Comments
 (0)