Skip to content

Commit

Permalink
Adding content-type to javascript file deployment to Azure storage ac…
Browse files Browse the repository at this point in the history
…count
  • Loading branch information
plup2 committed Oct 25, 2021
1 parent b21ca3d commit 7106880
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ jobs:
path: ./dist
key: cache-release-${{ github.event.release.tag_name }}-esdcprod

# az connection string in environment variable AZURE_STORAGE_CONNECTION_STRING
# NOTE: az connection string in environment variable AZURE_STORAGE_CONNECTION_STRING
# NOTE: Javascript files need to be served with Content-Type 'application/javascript;charset=utf-8' to accomodate non UTF-8 application.
# The simplest way we found to do that is to batch re-upload .js files with explicit the content-type
# https://docs.microsoft.com/en-us/azure/storage/blobs/storage-blobs-static-site-github-actions
# https://docs.microsoft.com/en-us/cli/azure/storage/blob?view=azure-cli-latest#az_storage_blob_upload_batch
- name: Upload to Azure storage account
Expand All @@ -69,6 +71,7 @@ jobs:
azcliversion: 2.0.81
inlineScript: |
az storage blob upload-batch --destination testweb --source ./dist/app/cls/WET/gcweb/v4_0_44/cdts
az storage blob upload-batch --destination testweb --source ./dist/app/cls/WET/gcweb/v4_0_44/cdts --pattern "*.js" --content-type "application/javascript;charset=utf-8"
deploy-canada:
runs-on: ubuntu-latest
Expand Down

0 comments on commit 7106880

Please sign in to comment.