-
Notifications
You must be signed in to change notification settings - Fork 37
56 lines (45 loc) · 1.73 KB
/
deploy-zodiac-app.yaml
File metadata and controls
56 lines (45 loc) · 1.73 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
53
54
name: Deploy Zodiac App
env:
DEFAULT_LOCATION: uksouth
ZODIAC_ALIAS: cplzodiac
#on:
# push:
# paths:
# - Zodiac.Generator/**
on: [workflow_dispatch]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: 'Checkout GitHub Action'
uses: actions/checkout@master
- name: 'Login via Azure CLI'
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: 'Docker Login'
uses: azure/docker-login@v1
with:
login-server: ${{env.ZODIAC_ALIAS}}acr.azurecr.io
username: ${{env.ZODIAC_ALIAS}}acr
password: ${{ secrets.ACR_PASSWORD }}
- name: 'Compose Customized Docker Image'
shell: bash
run: |
docker build -f Zodiac.Generator/Dockerfile -t ${{env.ZODIAC_ALIAS}}acr.azurecr.io/zodiac/generator:${{github.run_number}} .
docker push ${{env.ZODIAC_ALIAS}}acr.azurecr.io/zodiac/generator:${{github.run_number}}
- name: 'Set Function App Docker Image'
shell: bash
run: |
az functionapp config container set --docker-custom-image-name ${{env.ZODIAC_ALIAS}}acr.azurecr.io/zodiac/generator:${{github.run_number}} \
--docker-registry-server-password ${{ secrets.ACR_PASSWORD }} \
--docker-registry-server-url https://${{env.ZODIAC_ALIAS}}acr.azurecr.io \
--docker-registry-server-user ${{env.ZODIAC_ALIAS}}acr \
--name ${{env.ZODIAC_ALIAS}}-gen-func \
--resource-group ${{env.ZODIAC_ALIAS}}-rg
az webapp log config --docker-container-logging filesystem \
--name ${{env.ZODIAC_ALIAS}}-gen-func \
--resource-group ${{env.ZODIAC_ALIAS}}-rg
- name: Azure logout
run: |
az logout