Skip to content

fix apply-iac workflow & production backend-service #39

fix apply-iac workflow & production backend-service

fix apply-iac workflow & production backend-service #39

Workflow file for this run

name: Primary Workflow
concurrency:
group: iac
cancel-in-progress: true
on:
push:
permissions:
id-token: write
contents: read
env:
TF_VERSION: '1.6.2'
TG_VERSION: '0.55.15'
AWS_REGION: us-east-1
jobs:
detect-changes:
runs-on: ubuntu-latest
outputs:
run-iac: ${{ steps.check.outputs.run-iac }}
run-backend: ${{ steps.check.outputs.run-backend }}
run-frontend: ${{ steps.check.outputs.run-frontend }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: check
with:
filters: |
run-iac:
- 'tofu/**'
- '.github/workflows/**'
run-backend:
- 'backend/**'
run-frontend:
- 'frontend/**'
verify-iac:
needs: detect-changes
if: github.ref != 'refs/heads/main' && needs.detect-changes.outputs.run-iac == 'true'
strategy:
max-parallel: 1
matrix:
environment: [stage, production]
uses: ./.github/workflows/verify-iac.yaml
with:
tf_version: 1.6.2
tg_version: 0.55.15
aws_region: us-east-1
environment: ${{ matrix.environment }}
secrets: inherit
apply-iac:
needs: detect-changes
if: github.ref == 'refs/heads/add-tf-iac' && needs.detect-changes.outputs.run-iac == 'true'
strategy:
max-parallel: 1
matrix:
environment: [stage]
uses: ./.github/workflows/apply-iac.yaml
with:
tf_version: 1.6.2
tg_version: 0.55.15
aws_region: us-east-1
environment: ${{ matrix.environment }}
secrets: inherit
ci-tests:
needs: detect-changes
if: github.ref == 'refs/heads/add-tf-iac' && (needs.detect-changes.outputs.run-backend == 'true' || needs.detect-changes.outputs.run-frontend == 'true')
uses: ./.github/workflows/ci-tests.yaml
verify-backend:
needs: detect-changes
if: github.ref != 'refs/heads/main' && needs.detect-changes.outputs.run-iac == 'true'
strategy:
max-parallel: 1
matrix:
environment: [stage, production]
uses: ./.github/workflows/verify-backend.yaml
with:
tf_version: 1.6.2
tg_version: 0.55.15
aws_region: us-east-1
environment: ${{ matrix.environment }}
secrets: inherit
deploy-backend:
needs: detect-changes
if: github.ref == 'refs/heads/add-tf-iac' && needs.detect-changes.outputs.run-backend == 'true'
strategy:
max-parallel: 1
matrix:
environment: [stage]
uses: ./.github/workflows/deploy-backend.yaml
with:
tf_version: 1.6.2
tg_version: 0.55.15
aws_region: us-east-1
environment: ${{ matrix.environment }}
secrets: inherit
deploy-frontend:
needs: detect-changes
if: github.ref == 'refs/heads/add-tf-iac' && needs.detect-changes.outputs.run-frontend == 'true'
uses: ./.github/workflows/deploy-frontend.yaml
with:
aws_region: us-east-1
bucket: tb-apmt-stage-frontend
build_environment: staging
secrets: inherit