-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathblob-sync-action.yml
More file actions
52 lines (44 loc) · 1.4 KB
/
blob-sync-action.yml
File metadata and controls
52 lines (44 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Sync Resume to Azure Storage
on:
push:
branches:
- main
paths:
- 'frontend/**'
jobs:
sync-to-azure:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Login to Azure
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Debug Directory
run: ls -l frontend # Verify frontend folder exists before uploading
- name: Create container if not exists
shell: bash
run: |
az storage container create \
--name "${{ secrets.CONTAINER_NAME }}" \
--account-name "${{ secrets.STORAGE_ACCOUNT_NAME }}" \
--auth-mode login \
--public-access off
- name: Upload to Blob Storage
shell: bash
run: |
az storage blob upload-batch \
--account-name "${{ secrets.STORAGE_ACCOUNT_NAME }}" \
--auth-mode login \
--source "frontend" \
--destination "${{ secrets.CONTAINER_NAME }}"
- name: Purge Front Door Endpoint
shell: bash
run: |
az afd endpoint purge \
--resource-group "${{ secrets.RESOURCE_GROUP }}" \
--profile-name "${{ secrets.FRONTDOOR_NAME }}" \
--endpoint-name "${{ secrets.FRONTDOOR_ENDPOINT }}" \
--content-paths "/*" \
--no-wait