Skip to content

Commit 364ff4d

Browse files
committed
(Fix) Paths to Terraform backend state for infra required correction in deploy-infrastructure and validate-templates Github Action workflows
1 parent 510626e commit 364ff4d

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

.github/workflows/deploy-infrastructure.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ jobs:
359359
- name: Download Backend Configuration
360360
uses: actions/download-artifact@v4
361361
with:
362-
name: backend-config-${{ needs.validate.outputs.deploy_env }}-${{ github.run_id }}
362+
name: backend-config-${{ needs.validate.outputs.deploy_env }}-infra-${{ github.run_id }}
363363
path: environments/${{ needs.validate.outputs.deploy_env }}/infra
364364

365365
- name: Verify Backend Configuration
@@ -521,7 +521,7 @@ jobs:
521521
- name: Download Backend Configuration
522522
uses: actions/download-artifact@v4
523523
with:
524-
name: backend-config-${{ needs.validate.outputs.deploy_env }}-${{ github.run_id }}
524+
name: backend-config-${{ needs.validate.outputs.deploy_env }}-infra-${{ github.run_id }}
525525
path: environments/${{ needs.validate.outputs.deploy_env }}/infra
526526

527527
- name: Initialize Terraform Backend

.github/workflows/validate-templates.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,7 @@ jobs:
353353
with:
354354
bucket_name: ${{ github.event.inputs.bucket_name }}
355355
environment: ${{ github.event.inputs.test_environment }}
356+
phase: infra
356357
region: ${{ github.event.inputs.region }}
357358
action: create
358359
force_recreate: false
@@ -395,12 +396,12 @@ jobs:
395396
- name: Download Backend Configuration
396397
uses: actions/download-artifact@v4
397398
with:
398-
name: backend-config-${{ github.event.inputs.test_environment || 'dev' }}-${{ github.run_id }}
399-
path: ./
399+
name: backend-config-${{ github.event.inputs.test_environment }}-infra-${{ github.run_id }}
400+
path: environments/${{ github.event.inputs.test_environment }}/infra
400401

401402
- name: Initialize Test Environment Backend
402403
run: |
403-
cd environments/${{ github.event.inputs.test_environment || 'dev' }}
404+
cd environments/${{ github.event.inputs.test_environment }}/infra
404405
405406
echo "🔄 Initializing with remote backend..."
406407
echo "Backend bucket: ${{ needs.setup-backend.outputs.bucket_name }}"
@@ -409,7 +410,7 @@ jobs:
409410
- name: Deploy Test Environment
410411
id: deploy-env
411412
run: |
412-
cd environments/${{ github.event.inputs.test_environment || 'dev' }}
413+
cd environments/${{ github.event.inputs.test_environment }}/infra
413414
414415
# Plan and apply minimal environment for testing
415416
terraform plan -out=test.tfplan
@@ -424,14 +425,14 @@ jobs:
424425
425426
# Validate the deployed environment
426427
./scripts/validate.sh \
427-
--env=${{ github.event.inputs.test_environment || 'dev' }} \
428+
--env=${{ github.event.inputs.test_environment }} \
428429
--components=coder \
429430
--detailed
430431
431432
- name: Cleanup Test Environment
432433
if: always() && steps.deploy-env.outputs.environment_deployed == 'true'
433434
run: |
434-
cd environments/${{ github.event.inputs.test_environment || 'dev' }}
435+
cd environments/${{ github.event.inputs.test_environment || 'dev' }}/infra
435436
436437
# Clean up the test environment
437438
echo "🔥 Cleaning up test environment..."

0 commit comments

Comments
 (0)