Skip to content

Commit ac6ffdd

Browse files
committed
Remove redundant deploy workflow
1 parent 20a1e29 commit ac6ffdd

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

.github/workflows/terraform.yaml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@ jobs:
5252
# 4. Terraform Init (with backend config flags)
5353
- name: Terraform Init
5454
run: |
55-
cd quest-gitops
55+
if [ -z "${{ secrets.TERRAFORM_STATE_BUCKET }}" ]; then
56+
echo "ERROR: TERRAFORM_STATE_BUCKET secret is not set. Set the secret in repo Settings -> Secrets and variables -> Actions." >&2
57+
exit 1
58+
fi
5659
terraform init \
5760
-backend-config="bucket=${{ secrets.TERRAFORM_STATE_BUCKET }}" \
5861
-backend-config="key=quest/terraform.tfstate" \
@@ -65,22 +68,19 @@ jobs:
6568
# 5. Terraform Validate
6669
- name: Terraform Validate
6770
run: |
68-
cd quest-gitops
6971
terraform validate
7072
terraform fmt -check
7173
continue-on-error: true
7274

7375
# 6. Terraform Plan
7476
- name: Terraform Plan
7577
run: |
76-
cd quest-gitops
7778
terraform plan -out=tfplan -var='manage_state_bucket=false'
7879
id: plan
7980

8081
# 7. Show Plan
8182
- name: Show Terraform Plan
8283
run: |
83-
cd quest-gitops
8484
terraform show -json tfplan | jq '.resource_changes[] | select(.change.actions != ["no-op"])' | head -100
8585
8686
# 8. Comment Plan on PR (if PR)
@@ -112,7 +112,6 @@ jobs:
112112
(github.event_name == 'push' && github.ref == 'refs/heads/main') ||
113113
(github.event_name == 'workflow_dispatch' && github.event.inputs.action == 'apply')
114114
run: |
115-
cd quest-gitops
116115
terraform apply -auto-approve -input=false -var='manage_state_bucket=false' tfplan
117116
env:
118117
TF_INPUT: false
@@ -121,7 +120,6 @@ jobs:
121120
- name: Terraform Destroy
122121
if: github.event_name == 'workflow_dispatch' && github.event.inputs.action == 'destroy'
123122
run: |
124-
cd quest-gitops
125123
terraform destroy -auto-approve -var='manage_state_bucket=false'
126124
env:
127125
TF_INPUT: false
@@ -130,6 +128,5 @@ jobs:
130128
- name: Get ALB DNS
131129
if: success()
132130
run: |
133-
cd quest-gitops
134131
terraform output -json | jq '.alb_dns_name // empty' || echo "No ALB DNS available"
135132
continue-on-error: true

0 commit comments

Comments
 (0)