-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (47 loc) · 1.5 KB
/
azure-client-storage.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
51
52
53
54
55
56
57
# https://docs.microsoft.com/en-us/azure/storage/blobs/storage-blobs-static-site-github-actions
name: Deploy Client to Azure Storage
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
AZURE_CLIENT_PATH: 'Client'
DOTNET_VERSION: '6.0.x'
permissions:
id-token: write
contents: read
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@v3
- name: Setup DotNet ${{ env.DOTNET_VERSION }} Environment
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: 'Build'
shell: bash
run: |
pushd './${{ env.AZURE_CLIENT_PATH }}'
dotnet workload install wasm-tools
dotnet publish --configuration Release --output ./output
mv ./output/wwwroot/* ./output/
popd
- name: 'Login to Azure'
uses: azure/login@v1
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- name: 'Deploy'
uses: azure/CLI@v1
with:
inlineScript: |
az storage blob delete-batch --account-name couple --auth-mode key --source '$web'
az storage blob upload-batch --account-name couple --auth-mode key --destination '$web' --source ./Client/output
- name: 'Logout of Azure'
run: |
az logout
if: always()