-
Notifications
You must be signed in to change notification settings - Fork 6
57 lines (51 loc) · 1.87 KB
/
deploy-infra.yml
File metadata and controls
57 lines (51 loc) · 1.87 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
55
56
57
name: Deploy Backend Infra
on:
push:
branches:
- main
workflow_dispatch:
jobs:
create-infra:
runs-on: ubuntu-latest
# needs: create-backend
# defaults:
# run:
# working-directory: .github/workflows
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Terraform init
uses: hashicorp/setup-terraform@v1
- name: Terraform plan
working-directory: .github/workflows
run: |
terraform init -upgrade
terraform plan -out=tfplan
env:
TF_VAR_subscription_id: ${{ secrets.TF_VAR_subscription_id }}
TF_VAR_client_id: ${{ secrets.TF_VAR_client_id }}
TF_VAR_client_secret: ${{ secrets.TF_VAR_client_secret }}
TF_VAR_tenant_id: ${{ secrets.TF_VAR_tenant_id }}
TF_VAR_gateway: ${{secrets.TF_VAR_gateway}}
TF_VAR_app_key: ${{secrets.TF_VAR_app_key}}
TF_VAR_secret: ${{secrets.TF_VAR_secret}}
TF_VAR_single_key: ${{secrets.TF_VAR_single_key}}
TF_VAR_sql_password: ${{secrets.TF_VAR_sql_password}}
- name: Terraform apply
working-directory: .github/workflows
run: |
terraform apply -auto-approve tfplan
env:
TF_VAR_subscription_id: ${{ secrets.TF_VAR_subscription_id }}
TF_VAR_client_id: ${{ secrets.TF_VAR_client_id }}
TF_VAR_client_secret: ${{ secrets.TF_VAR_client_secret }}
TF_VAR_tenant_id: ${{ secrets.TF_VAR_tenant_id }}
TF_VAR_gateway: ${{secrets.TF_VAR_gateway}}
TF_VAR_app_key: ${{secrets.TF_VAR_app_key}}
TF_VAR_secret: ${{secrets.TF_VAR_secret}}
TF_VAR_single_key: ${{secrets.TF_VAR_single_key}}
TF_VAR_sql_password: ${{secrets.TF_VAR_sql_password}}
deploy-backend:
needs: [create-infra]
secrets: inherit
uses: ./.github/workflows/deploy-backend.yml