-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (41 loc) · 1.49 KB
/
deploy_prod.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
name: Deploy Backend to Production Environment
on:
push:
branches:
- main
permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
jobs:
deploy-prod:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Sam CLI
uses: aws-actions/setup-sam@v2
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18.x'
- name: Cache Node.js modules
uses: actions/cache@v3
with:
path: backend/node_modules
key: ${{ runner.os }}-backend-node-${{ hashFiles('backend/package-lock.json') }}
restore-keys: |
${{ runner.os }}-backend-node-
- name: Install dependencies
working-directory: backend
run: npm install
- name: Build
working-directory: backend
run: npm run build:linux
- name: Configure AWS Credentials for Production Account
uses: aws-actions/[email protected]
with:
role-to-assume: arn:aws:iam::864899856155:role/GitHubDeployRole
aws-region: us-east-2
- name: Deploy to Production
working-directory: backend
run: sam deploy --no-confirm-changeset --no-fail-on-empty-changeset --parameter-overrides Stage=prod