From ba55249777d1c7e6486ae5d237740f688985db1c Mon Sep 17 00:00:00 2001 From: Prashant Srivastav Date: Fri, 12 Jun 2026 21:39:27 +0800 Subject: [PATCH] fix: deployment for azure --- .github/workflows/deploy.yml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index dee8575..b66ba37 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -54,12 +54,26 @@ jobs: if: github.event_name == 'push' && github.ref == 'refs/heads/main' run: | VERSION=$(node -p "require('./package.json').version") + LATEST_BLOB="public/scripts/app.min.js" + VERSIONED_BLOB="public/scripts/v${VERSION}/app.min.js" + + az storage blob lease break \ + --account-name "$AZURE_STORAGE_ACCOUNT" \ + --container-name "$AZURE_STORAGE_CONTAINER" \ + --blob-name "$LATEST_BLOB" \ + --auth-mode login || true + + az storage blob lease break \ + --account-name "$AZURE_STORAGE_ACCOUNT" \ + --container-name "$AZURE_STORAGE_CONTAINER" \ + --blob-name "$VERSIONED_BLOB" \ + --auth-mode login || true # Latest - short cache az storage blob upload \ --account-name "$AZURE_STORAGE_ACCOUNT" \ --container-name "$AZURE_STORAGE_CONTAINER" \ - --name "public/scripts/app.min.js" \ + --name "$LATEST_BLOB" \ --file "./dist/app.min.js" \ --content-type "application/javascript" \ --content-cache-control "public,max-age=3600" \ @@ -70,7 +84,7 @@ jobs: az storage blob upload \ --account-name "$AZURE_STORAGE_ACCOUNT" \ --container-name "$AZURE_STORAGE_CONTAINER" \ - --name "public/scripts/v${VERSION}/app.min.js" \ + --name "$VERSIONED_BLOB" \ --file "./dist/app.min.js" \ --content-type "application/javascript" \ --content-cache-control "public,max-age=31536000,immutable" \