Skip to content

Commit

Permalink
This time for real maybe
Browse files Browse the repository at this point in the history
  • Loading branch information
Guysnacho committed Sep 23, 2024
1 parent 37a6f66 commit 0ebcc20
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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: |
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/predeploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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: |
Expand Down

0 comments on commit 0ebcc20

Please sign in to comment.