Skip to content

Commit

Permalink
ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Geoff Kendal committed Jan 31, 2024
1 parent c44e330 commit 868ef9b
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
name: Build React App
name: Build and Deploy

on:
push:
branches:
- master

jobs:
build:
build-and-deploy:
runs-on: ubuntu-latest

strategy:
matrix:
environment: ['dev', 'prod']

steps:
- name: Checkout repository
uses: actions/checkout@v2
Expand All @@ -19,9 +23,20 @@ jobs:
node-version: 'lts/*'

- name: Install dependencies
run: npm ci
working-directory: frontend
run: npm install

- name: Build React app
working-directory: frontend
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"

0 comments on commit 868ef9b

Please sign in to comment.