-
-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (47 loc) · 1.24 KB
/
deploy.yml
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
name: Deploy MyFi CDN
on:
push:
branches:
- main
env:
AZURE_FUNCTIONAPP_PACKAGE_PATH: '.'
CARGO_TERM_COLOR: always
ACCOUNT_NAME: myficdn
PROFILE_NAME: myficdnprofile
PROFILE_ACCOUNT_NAME: myficdn
jobs:
copy-files:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Azure Login
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Copy Files to Azure Blob Storage
uses: azure/CLI@v1
with:
inlineScript: |
az storage copy -s 'cdn/*' --destination-account-name ${{ env.ACCOUNT_NAME }} --destination-container '$web' --recursive
- name: logout
run: |
az logout
if: always()
purge-storage-cache:
runs-on: ubuntu-latest
timeout-minutes: 5
needs: copy-files
steps:
- name: Azure Login
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Purge Storage Cache
uses: azure/CLI@v1
with:
inlineScript: |
az cdn endpoint purge -g ${{ secrets.AZURE_RESOURCE_GROUP }} -n ${{ env.PROFILE_ACCOUNT_NAME }} --profile-name ${{ env.PROFILE_NAME }} --content-paths '/*'
- name: logout
run: |
az logout
if: always()