Fix cli env update potentially maybe #47
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
pull_request: | |
branches: | |
- "**" | |
permissions: | |
pull-requests: write | |
name: 🌱 Plan, Build 🧪 | |
jobs: | |
TF-Apply: | |
name: 🏗️ Plan Infra | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check Out | |
uses: actions/checkout@v4 | |
- name: Setup Terraform | |
uses: hashicorp/setup-terraform@v3 | |
with: | |
cli_config_credentials_token: ${{ secrets.TF_API_TOKEN }} | |
terraform_version: 1.9.2 | |
- name: Look around nd Init 👁️👁️ | |
run: | | |
echo Looking around 👁️👁️ | |
ls | |
cd terraform | |
echo Looking around 👁️👁️ | |
ls | |
terraform init | |
- name: 🏗️ Terraform Plan | |
run: | | |
cd terraform | |
terraform plan -var="bucket-name=${{ secrets.S3_BUCKET }}" -var="db-name=${{ secrets.DB_NAME }}" -var="db-username=${{ secrets.DB_USER }}" # -auto-approve | |
- run: echo ${{ steps.plan.outputs.stdout }} | |
- run: echo ${{ steps.plan.outputs.stderr }} | |
- run: echo ${{ steps.plan.outputs.exitcode }} | |
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 }} | |
needs: ["TF-Apply"] | |
steps: | |
- name: Check Out | |
uses: actions/checkout@v4 | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v4.0.2 | |
with: | |
aws-region: us-west-2 | |
aws-access-key-id: ${{secrets.AWS_ACCESS_KEY_ID}} | |
aws-secret-access-key: ${{secrets.AWS_SECRET_ACCESS_KEY}} | |
- name: Setup Terraform | |
uses: hashicorp/setup-terraform@v3 | |
- name: 😪 Installing Dependencies | |
run: | | |
cd web | |
npm install | |
- name: ⚗️ Write env variables | |
run: | | |
cd web | |
echo NEXT_PUBLIC_APIGW=$(terraform output -raw api-route) > .env | |
- name: 🔨 Build Project | |
run: | | |
cd web | |
npm run build |