-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (42 loc) · 1.27 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: Build & Deploy
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
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
working-directory: frontend
run: npm ci
- name: Build React app
working-directory: frontend
run: npm run build
deploy-dev:
runs-on: ubuntu-latest
needs: build
permissions:
id-token: write
contents: read
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: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::603042156394:role/_github_actions
aws-region: eu-west-1
- name: Run Terragrunt
run: terragrunt apply -auto-approve
working-directory: environments/dev