forked from tlc-pack/ci
-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (45 loc) · 1.5 KB
/
terraform_apply.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
name: terraform apply
on:
push:
branches:
- main
paths:
- terraform/**
workflow_dispatch:
concurrency:
group: terraform_apply
cancel-in-progress: true
jobs:
apply:
runs-on: ubuntu-latest
env:
AWS_ACCESS_KEY_ID: ${{ secrets.TERRAFORM_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.TERRAFORM_AWS_SECRET_ACCESS_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TF_VAR_tvm_bot_webhook_secret: ${{ secrets.TVM_BOT_WEBHOOK_SECRET }}
TF_VAR_tvm_bot_github_token: ${{ secrets.TVM_BOT_GITHUB_TOKEN }}
TF_VAR_tvm_bot_repo: tvm
TF_VAR_tvm_bot_owner: apache
defaults:
run:
working-directory: ./terraform
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Terraform Apply
if: ${{ github.ref == 'refs/heads/main' && github.event_name != 'workflow_dispatch' }}
uses: dflook/terraform-apply@e1c1b7e1d0eed8bda30338e54ff3cd6790a6f35b #v1.25.1
with:
var_file: |
terraform/vars/tvm-ci-prod.auto.tfvars
workspace: tvm-ci-prod
path: ./terraform
- name: Terraform Apply (workflow dispatch)
if: ${{ github.ref == 'refs/heads/main' && github.event_name == 'workflow_dispatch' }}
uses: dflook/terraform-apply@e1c1b7e1d0eed8bda30338e54ff3cd6790a6f35b #v1.25.1
with:
var_file: |
terraform/vars/tvm-ci-prod.auto.tfvars
workspace: tvm-ci-prod
path: ./terraform
auto_approve: true