-
Notifications
You must be signed in to change notification settings - Fork 9
73 lines (60 loc) · 1.88 KB
/
azure-storage-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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: Storage
on: [push, workflow_dispatch]
env:
AZURE_RESOURCE_GROUP: blazor-deployment-samples
BLOB_STORAGE_ACCOUNT_NAME: timheuerblazorwasm
defaults:
run:
working-directory: blazor-sample-app
jobs:
build:
if: (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && contains(toJson(github.event.commits), '***NO_CI***') == false && contains(toJson(github.event.commits), '[ci skip]') == false && contains(toJson(github.event.commits), '[skip ci]') == false
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.300
- name: Restore
run: dotnet restore
- name: Build with dotnet
run: dotnet build --configuration Release --no-restore
- name: Publish with dotnet
run: dotnet publish --configuration Release -o ../published_app --no-build
- name: Publish artifacts
uses: actions/upload-artifact@v2
with:
name: webapp
path: published_app/wwwroot
deploy:
needs: build
name: Deploy
runs-on: ubuntu-latest
steps:
# Download artifacts
- name: Download artifacts
uses: actions/download-artifact@v2
with:
name: webapp
# Authentication
- name: Authenticate with Azure
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
# Deploy to storage using CLI
- name: Deploy to storage using CLI
uses: azure/CLI@v1
with:
azcliversion: latest
inlineScript: |
# show azure account being used
az account show
# az storage account upload
az storage blob upload-batch --account-name ${{ env.BLOB_STORAGE_ACCOUNT_NAME }} -s . -d \$web
# Azure logout
- name: logout
working-directory: .
run: |
az logout