-
Notifications
You must be signed in to change notification settings - Fork 1
51 lines (47 loc) · 1.26 KB
/
terraform_apply.yaml
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: "Terraform Deploy"
on:
push:
branches:
- main
paths:
- 'aws-tf/**'
# workflow_call:
# inputs:
# environment:
# required: true
# type: string
# secrets:
# TF_API_TOKEN:
# required: true
jobs:
deploy:
#environment: ${{ inputs.environment }}
environment: production
runs-on: ubuntu-latest
defaults:
run:
working-directory: aws-tf
steps:
- uses: actions/checkout@v3 # setup the repository in the runner
- name: Setup Node.js # setup Node.js in the runner
uses: actions/setup-node@v3
with:
node-version: 18
- name: Generate module and provider bindings
run: npx cdktf-cli get
- run: npm ci
- name: Setup Terraform
uses: hashicorp/setup-terraform@v2
with:
cli_config_credentials_token: ${{ secrets.TF_API_TOKEN }}
- name: Run Terraform CDK
uses: hashicorp/terraform-cdk-action@v0.1.0
with:
terraformVersion: 1.3.9
cdktfVersion: 0.15.5
stackName: aws-tf
# mode: plan-only
mode: auto-approve-apply
githubToken: ${{ secrets.GITHUB_TOKEN }}
terraformCloudToken: ${{ secrets.TF_API_TOKEN }}
workingDirectory: aws-tf