-
Notifications
You must be signed in to change notification settings - Fork 9
55 lines (44 loc) · 1.44 KB
/
azure-app-svc-linux-container.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
name: Container Deploy
on: [push]
env:
AZURE_RESOURCE_GROUP: blazor-deployment-samples
AZURE_APP_NAME: bwasmcontainerapp
jobs:
build:
if: github.event_name == 'push' && 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 Container Image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: 'Login via Azure CLI'
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CONTAINER_CREDS }}
- uses: azure/docker-login@v1
with:
login-server: bwasm.azurecr.io
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- run: |
docker build blazor-sample-app/ -t bwasm.azurecr.io/bwasm:${{ github.sha }}
docker push bwasm.azurecr.io/bwasm:${{ github.sha }}
- name: Azure logout
run: |
az logout
deploy:
needs: build
name: Deploy from ACR
runs-on: ubuntu-latest
steps:
- name: 'Login via Azure CLI'
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CONTAINER_CREDS }}
- name: 'Deploy from ACR'
uses: azure/webapps-deploy@v2
with:
app-name: '${{ env.AZURE_APP_NAME }}'
images: 'bwasm.azurecr.io/bwasm:${{ github.sha }}'
- name: Azure logout
run: |
az logout