From 36f4dd41e87173a2a44c73f18437020ec77e9806 Mon Sep 17 00:00:00 2001 From: shanice-skylight <150187231+shanice-skylight@users.noreply.github.com> Date: Tue, 18 Feb 2025 18:52:23 -0500 Subject: [PATCH] Fix terraform deployment (#378) Co-authored-by: Johanna <103958711+johanna-skylight@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Rob Mitchell <40571882+robertandremitchell@users.noreply.github.com> Co-authored-by: Rob Mitchell Co-authored-by: Nick Clyde --- .github/workflows/ecs_terraform.yaml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ecs_terraform.yaml b/.github/workflows/ecs_terraform.yaml index 23c29683..9319b3ff 100644 --- a/.github/workflows/ecs_terraform.yaml +++ b/.github/workflows/ecs_terraform.yaml @@ -28,9 +28,6 @@ permissions: id-token: write contents: read -env: - workspace: ${{ github.event.inputs.workspace }} - jobs: check-dependencies: runs-on: ubuntu-latest @@ -75,6 +72,8 @@ jobs: terraform: needs: check-dependencies runs-on: ubuntu-latest + outputs: + workspace: ${{ steps.set-workspace.outputs.workspace }} defaults: run: shell: bash @@ -99,12 +98,23 @@ jobs: role-to-assume: ${{ secrets.AWS_ROLE_ARN }} aws-region: ${{ secrets.AWS_REGION }} + - name: Set workspace + id: set-workspace + run: |- + echo "workspace=$( + if [[ "${{ github.event.inputs.workspace }}" != "" ]]; then + echo ${{ github.event.inputs.workspace}} + else + echo dev + fi + )" >> $GITHUB_OUTPUT + - name: Terraform env: BUCKET: ${{ secrets.TFSTATE_BUCKET }} DYNAMODB_TABLE: ${{ secrets.TFSTATE_DYNAMODB_TABLE }} REGION: ${{ vars.region }} - WORKSPACE: ${{ env.workspace }} + WORKSPACE: ${{ steps.set-workspace.outputs.workspace }} UMLS_API_KEY: ${{ secrets.UMLS_API_KEY }} ERSD_API_KEY: ${{ secrets.ERSD_API_KEY}} TLS_CERT: ${{ secrets.TLS_CERT}}