From 0ebcc208157b68a5d6d29ff4b0cb0942e78d9edc Mon Sep 17 00:00:00 2001 From: Samuel Adetunji Date: Mon, 23 Sep 2024 03:57:40 -0500 Subject: [PATCH] This time for real maybe --- .github/workflows/main.yml | 8 ++++++-- .github/workflows/predeploy.yml | 11 ++++++----- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c4b4518..23a719b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -34,13 +34,17 @@ jobs: - run: echo ${{ steps.plan.outputs.stdout }} - run: echo ${{ steps.plan.outputs.stderr }} - run: echo ${{ steps.plan.outputs.exitcode }} + - name: Fetch API GW + id: APIGW + run: | + cd terraform + echo "NEXT_PUBLIC_APIGW=$(terraform output -raw api-route)" >> $GITHUB_OUTPUT web-deploy: name: 💫 Deploy runs-on: ubuntu-latest env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - APIGW: ${{needs.TF-Apply.outputs.apigw}} needs: ["TF-Apply"] steps: - name: Check Out @@ -62,7 +66,7 @@ jobs: - name: ⚗️ Write env variables run: | cd web - echo NEXT_PUBLIC_APIGW=$APIGW > .env + echo ${{steps.APIGW.outputs.APIGW}} > .env - name: 🔨 Build Project run: | diff --git a/.github/workflows/predeploy.yml b/.github/workflows/predeploy.yml index b98710b..1734025 100644 --- a/.github/workflows/predeploy.yml +++ b/.github/workflows/predeploy.yml @@ -9,9 +9,6 @@ jobs: TF-Apply: name: 🏗️ Plan Infra runs-on: ubuntu-latest - outputs: - # https://unix.stackexchange.com/questions/281309/shell-syntax-how-to-correctly-use-to-break-lines - apigw: cd terraform && terraform output -raw api-route steps: - name: Check Out uses: actions/checkout@v4 @@ -35,13 +32,17 @@ jobs: - run: echo ${{ steps.plan.outputs.stdout }} - run: echo ${{ steps.plan.outputs.stderr }} - run: echo ${{ steps.plan.outputs.exitcode }} + - name: Fetch API GW + id: APIGW + run: | + cd terraform + echo "NEXT_PUBLIC_APIGW=$(terraform output -raw api-route)" >> $GITHUB_OUTPUT web-deploy: name: 💫 Build runs-on: ubuntu-latest env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - APIGW: ${{needs.TF-Apply.outputs.apigw}} needs: ["TF-Apply"] steps: - name: Check Out @@ -64,7 +65,7 @@ jobs: - name: ⚗️ Write env variables run: | cd web - echo NEXT_PUBLIC_APIGW=$APIGW > .env + echo ${{steps.APIGW.outputs.APIGW}} > .env - name: 🔨 Build Project run: |