forked from RekhuGopal/msdocs-python-flask-container-web-app
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAzureBuildDeployContainerApp.yml
More file actions
51 lines (41 loc) · 1.24 KB
/
AzureBuildDeployContainerApp.yml
File metadata and controls
51 lines (41 loc) · 1.24 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
name: Build and Deploy Container App
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v2
- name: Setup Terraform
uses: hashicorp/setup-terraform@v2.0.2
with:
terraform_version: latest
cli_config_credentials_token: ${{ secrets.TFC_TOKEN_ID }}
- name: Terraform Init
id: init
run: terraform -chdir="./iac" init
- name: Terraform Validate
id: validate
run: terraform -chdir="./iac" validate
- name: Terraform Plan
id: plan
run: terraform -chdir="./iac" plan
continue-on-error: true
- name: Terraform Plan Status
if: steps.plan.outcome == 'failure'
run: exit 1
- name: Terraform Apply
run: terraform -chdir="./iac" apply -auto-approve
- name: Terraform Output
run: terraform output
- uses: azure/docker-login@v1
with:
login-server: cloudquickstartregistry.azurecr.io
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- run: |
docker build . -t cloudquickstartregistry.azurecr.io/myapp:1.0.0
docker push cloudquickstartregistry.azurecr.io/myapp:1.0.0