Skip to content

Commit

Permalink
Change caching behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
reknih committed May 15, 2024
1 parent 4f4adea commit 92aab43
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,31 @@ jobs:
- name: Package
run: bundler/target/release/bundler

- uses: azure/login@v1
- uses: kheiakiyama/install-azcopy-action@v1
with:
version: 'v10'
creds: ${{ secrets.AZURE_PACKAGE_CREDENTIALS }}

- name: Sync files
uses: azure/CLI@v1
env:
ACCOUNT_NAME: typstpackages
run: |
cd dist
azcopy_v10 cp --recursive . "https://$ACCOUNT_NAME.blob.core.windows.net/\$web" \
--overwrite true --exclude-pattern '*.json' \
--cache-control 'public, max-age=7776000' --put-md5
azcopy_v10 cp --recursive . "https://$ACCOUNT_NAME.blob.core.windows.net/\$web" \
--overwrite true --include-pattern '*.json' \
--cache-control 'must-revalidate' --put-md5
- name: Log in to Azure
uses: azure/login@v2
with:
inlineScript: az storage blob sync --account-name typstpackages --container '$web' --source ./dist --delete-destination true
creds: ${{ secrets.AZURE_PACKAGE_CREDENTIALS }}

- name: Purge CDN endpoint
uses: azure/CLI@v1
uses: azure/CLI@v2
with:
inlineScript: az afd endpoint purge -g Landing-Page --profile-name LandingPage --content-paths '/*' --endpoint-name 'packages'

Expand Down

0 comments on commit 92aab43

Please sign in to comment.