Skip to content

Commit

Permalink
install terragrunt
Browse files Browse the repository at this point in the history
  • Loading branch information
Geoff Kendal committed Jan 31, 2024
1 parent 868ef9b commit 874f8ad
Showing 1 changed file with 22 additions and 15 deletions.
37 changes: 22 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
name: Build and Deploy
name: Build & Deploy

on:
push:
branches:
- master

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

strategy:
matrix:
environment: ['dev', 'prod']
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
Expand All @@ -23,20 +20,30 @@ jobs:
node-version: 'lts/*'

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

- name: Build React app
run: npm run build
working-directory: frontend
run: npm run build

- name: Set environment variable for deployment
run: echo "TF_VAR_environment=${{ matrix.environment }}" >> $GITHUB_ENV

deploy-dev:
runs-on: ubuntu-latest
needs: build

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Install Terragrunt
run: wget https://github.com/gruntwork-io/terragrunt/releases/download/v0.54.22/terragrunt_linux_amd64 -O /usr/local/bin/terragrunt && chmod +x /usr/local/bin/terragrunt

- name: Set environment variable for dev deployment
run: echo "TF_VAR_environment=dev" >> $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"
working-directory: environments/dev


0 comments on commit 874f8ad

Please sign in to comment.