Skip to content

Workflow file for this run

name: Build and Deploy
on:
push:
branches:
- master
jobs:
build-and-deploy:
runs-on: ubuntu-latest
strategy:
matrix:
environment: ['dev', 'prod']
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Use Node.js LTS
uses: actions/setup-node@v3
with:
node-version: 'lts/*'
- name: Install dependencies
run: npm ci
working-directory: frontend
- name: Build React app
run: npm run build
working-directory: frontend
- name: Set environment variable for deployment
run: echo "TF_VAR_environment=${{ matrix.environment }}" >> $GITHUB_ENV
- name: Run Terragrunt
run: terragrunt apply -auto-approve
working-directory: environments/${{ matrix.environment }}
- name: Manual approval for production deployment
if: ${{ matrix.environment == 'prod' }}
run: echo "Approve the production deployment"