-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (47 loc) · 1.66 KB
/
terraform-terragrunt.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
name: Terraform Terragrunt Action
on:
push:
branches:
- main
workflow_dispatch: # Triggered manually from GitHub UI
jobs:
terraform:
runs-on: ubuntu-latest
env:
TF_WORKSPACE: terragrunt
# https://terragrunt.gruntwork.io/docs/getting-started/supported-versions/
THE_TG_VERSION: 0.57.0
THE_TF_VERSION: 1.8.0
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Terraform CLI
uses: hashicorp/setup-terraform@v3
with:
terraform_version: 1.8.0
terraform_wrapper: true
cli_config_credentials_token: ${{ secrets.TF_API_TOKEN }}
- name: Set up Terragrunt CLI
run: |
wget -qO /tmp/terragrunt https://github.com/gruntwork-io/terragrunt/releases/download/v0.57.0/terragrunt_linux_amd64
sudo chmod +x /tmp/terragrunt
sudo mv /tmp/terragrunt /usr/local/bin/terragrunt
echo "✅ Terragrunt CLI setup completed!"
- name: Run symlink-modules.sh
run: |
./symlink-modules.sh
echo "🔗 Symlink modules and workspace selection completed!"
- name: Terragrunt init
run: |
cd ./environment/stage
terragrunt init --terragrunt-non-interactive
echo "🔧 Terragrunt init completed!"
- name: Terragrunt plan
run: |
cd ./environment/stage
terragrunt plan --terragrunt-non-interactive
echo "📝 Terragrunt plan completed!"
- name: Display success message
if: github.event_name == 'workflow_dispatch'
run: |
echo "🚀 Terraform Terragrunt Action triggered manually!"