From 6ca0e3c8dc06b09072184a7277bacccfd9d2d74e Mon Sep 17 00:00:00 2001 From: nava-platform-bot Date: Fri, 5 Jul 2024 17:32:36 +0000 Subject: [PATCH] Template infra deploy #9811765241 --- .github/actions/setup-terraform/action.yml | 17 +++++++++++++++++ .github/workflows/build-and-publish.yml | 4 ++-- .github/workflows/database-migrations.yml | 3 +++ .github/workflows/deploy.yml | 3 +++ .template-version | 2 +- 5 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 .github/actions/setup-terraform/action.yml diff --git a/.github/actions/setup-terraform/action.yml b/.github/actions/setup-terraform/action.yml new file mode 100644 index 0000000..cd09f02 --- /dev/null +++ b/.github/actions/setup-terraform/action.yml @@ -0,0 +1,17 @@ +name: 'Set up Terraform' +description: 'Set up Terraform with the version stored in the .terraform-version file' +runs: + using: "composite" + steps: + - name: Get .terraform-version + id: get-terraform-version + run: | + terraform_version="$(cat .terraform-version)" + echo "Terraform version: ${terraform_version}" + echo "terraform_version=${terraform_version}" >> "$GITHUB_OUTPUT" + shell: bash + - name: Set up Terraform + uses: hashicorp/setup-terraform@v2 + with: + terraform_version: ${{ steps.get-terraform-version.outputs.terraform_version }} + terraform_wrapper: false diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml index fe332bb..feb7f9a 100644 --- a/.github/workflows/build-and-publish.yml +++ b/.github/workflows/build-and-publish.yml @@ -68,9 +68,9 @@ jobs: echo "is_image_published=$is_image_published" >> "$GITHUB_OUTPUT" - name: Build release - if: steps.check-image-published.outputs.IS_IMAGE_PUBLISHED == 'false' + if: steps.check-image-published.outputs.is_image_published == 'false' run: make APP_NAME=${{ inputs.app_name }} release-build - name: Publish release - if: steps.check-image-published.outputs.IS_IMAGE_PUBLISHED == 'false' + if: steps.check-image-published.outputs.is_image_published == 'false' run: make APP_NAME=${{ inputs.app_name }} release-publish diff --git a/.github/workflows/database-migrations.yml b/.github/workflows/database-migrations.yml index dc61e26..669d0bc 100644 --- a/.github/workflows/database-migrations.yml +++ b/.github/workflows/database-migrations.yml @@ -33,6 +33,9 @@ jobs: steps: - uses: actions/checkout@v3 + - name: Set up Terraform + uses: ./.github/actions/setup-terraform + - name: Configure AWS credentials uses: ./.github/actions/configure-aws-credentials with: diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index c5b4b6e..7a83b47 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -33,6 +33,9 @@ jobs: steps: - uses: actions/checkout@v3 + - name: Set up Terraform + uses: ./.github/actions/setup-terraform + - name: Configure AWS credentials uses: ./.github/actions/configure-aws-credentials with: diff --git a/.template-version b/.template-version index ea2f6de..99a22d3 100644 --- a/.template-version +++ b/.template-version @@ -1 +1 @@ -dab74fdbad679ed48657a2751f733353aff7ac23 +789a063ad88512edc2ac2ec971d67d1ea62ebfe5