-
Notifications
You must be signed in to change notification settings - Fork 18
42 lines (39 loc) · 1.17 KB
/
global-terraform-deploy.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
on:
push:
branches:
- main
paths:
- "infrastructure/global/**/*"
- "infrastructure/global/*"
name: Global Terraform Deploy
env:
TF_WORKSPACE: "default"
jobs:
apply-changes:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./infrastructure/global
steps:
- uses: actions/checkout@v4
- uses: hashicorp/setup-terraform@v3
with:
terraform_version: 1.2.4
- name: Terraform Init
run: terraform init
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
TF_IN_AUTOMATION: 1
- name: Terraform Validate
id: validate
run: terraform validate -no-color
- name: Terraform Apply
run: terraform apply -no-color -auto-approve &> /dev/null
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: eu-central-1
TF_IN_AUTOMATION: 1