diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 58be3ae..4d0b1b8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -31,12 +31,15 @@ jobs: - run: echo ${{ steps.plan.outputs.stdout }} - run: echo ${{ steps.plan.outputs.stderr }} - run: echo ${{ steps.plan.outputs.exitcode }} + outputs: + apigw: terraform output -raw api-route 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 @@ -58,7 +61,7 @@ jobs: - name: ⚗️ Write env variables run: | cd web - echo $(terraform output -raw api-route) > .env + echo NEXT_PUBLIC_APIGW=$APIGW > .env - name: 🔨 Build Project run: | diff --git a/.github/workflows/predeploy.yml b/.github/workflows/predeploy.yml index 5f5e96b..e645f89 100644 --- a/.github/workflows/predeploy.yml +++ b/.github/workflows/predeploy.yml @@ -32,12 +32,15 @@ jobs: - run: echo ${{ steps.plan.outputs.stdout }} - run: echo ${{ steps.plan.outputs.stderr }} - run: echo ${{ steps.plan.outputs.exitcode }} + outputs: + apigw: terraform output -raw api-route 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 @@ -60,7 +63,7 @@ jobs: - name: ⚗️ Write env variables run: | cd web - echo $(terraform output -raw api-route) > .env + echo NEXT_PUBLIC_APIGW=$APIGW > .env - name: 🔨 Build Project run: |