Skip to content

fix(azure-preview-workflow): update resource url to remove + use same token pattern #3979

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: spectrum-two
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions .github/workflows/publish-site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ permissions:
contents: read
pull-requests: write

env:
AZCOPY_AUTO_LOGIN_TYPE: SPN
AZCOPY_SPA_APPLICATION_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZCOPY_SPA_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
AZCOPY_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}

jobs:
build_and_deploy_job:
if: github.event_name == 'pull_request' && github.event.action != 'closed'
Expand Down Expand Up @@ -88,13 +94,11 @@ jobs:
- name: Deploy to Azure Blob Storage
id: deploy
env:
AZURE_STORAGE_SAS_TOKEN: ${{ secrets.AZURE_STORAGE_SAS_TOKEN }}
PR_HASH: ${{ steps.pr_hash.outputs.hash }}
run: |
CLEAN_SAS_TOKEN=$(echo "${AZURE_STORAGE_SAS_TOKEN}" | tr -d '\n\r\t ')
echo "Uploading Storybook to ${PR_HASH}"
azcopy copy "/home/runner/work/spectrum-css/spectrum-css/dist/*" --log-level=INFO \
"https://spectrumcss.blob.core.windows.net/\$web/${PR_HASH}/?${CLEAN_SAS_TOKEN}" \
"https://spectrumcss.blob.core.windows.net/\$web/${PR_HASH}/" \
--recursive \
--from-to LocalBlob
docs_url="https://spectrumcss.z13.web.core.windows.net/${PR_HASH}"
Expand Down Expand Up @@ -128,10 +132,9 @@ jobs:
sudo mv azcopy /usr/local/bin/
- name: Clean up PR deployment
env:
AZURE_STORAGE_SAS_TOKEN: ${{ secrets.AZURE_STORAGE_SAS_TOKEN }}
PR_HASH: ${{ steps.pr_hash.outputs.hash }}
run: |
echo "Cleaning up deployment: ${PR_HASH}/"
azcopy remove "https://spectrumcss.z13.web.core.windows.net/\$web/${PR_HASH}/?${AZURE_STORAGE_SAS_TOKEN}" \
azcopy remove "https://spectrumcss.blob.core.windows.net/\$web/${PR_HASH}/" \
--recursive || echo "Cleanup completed (some files may not exist)"
echo "Cleanup completed for PR deployment: ${PR_HASH}/"
Loading