-
Notifications
You must be signed in to change notification settings - Fork 10
57 lines (45 loc) · 1.51 KB
/
manual_terraform.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
# uses the terraform files from /cloud-infra dir to provision the infrastructure
name: "Manually Provision Terraform"
on:
workflow_dispatch:
jobs:
terraform:
name: "Provision Terraform"
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install Google Cloud SDK
uses: google-github-actions/setup-gcloud@v1
- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v1
with:
credentials_json: ${{ secrets.OWNER_SA_KEY }}
- name: Setup Terraform
uses: hashicorp/setup-terraform@v1
- name: "Setup GCP Credentials"
env:
GCP_OWNER_SA_KEY: ${{ secrets.OWNER_SA_KEY }}
run: |
echo "$GCP_OWNER_SA_KEY" > ./cloud-infra/credentials.json
- name: Terraform Init
working-directory: ./cloud-infra
run: |
terraform init
- name: Terraform Plan
working-directory: ./cloud-infra
run: |
terraform plan
- name: Hold for approval
if: github.event_name == 'workflow_dispatch'
uses: softprops/turnstyle@v1
with:
continue-after-seconds: 0 # This will make it wait indefinitely until manually approved
poll-interval-seconds: 10
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Terraform Apply
working-directory: ./cloud-infra
if: github.event_name == 'workflow_dispatch'
run: |
terraform apply -auto-approve