-
Notifications
You must be signed in to change notification settings - Fork 4
65 lines (55 loc) · 1.85 KB
/
deploy-int.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
59
60
61
62
63
64
65
name: Deploy int API
# Run when int branch is updated
on:
push:
branches:
- "int"
- "OC-963-fix"
permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
env:
NODE_VERSION: "20.18.0"
jobs:
migrate_db:
name: Migrate Database
uses: ./.github/workflows/migrate-db.yml
with:
ENVIRONMENT: "int"
secrets:
AWS_ROLE_ARN: ${{ secrets.AWS_ROLE_ARN }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
RDS_URL: ${{ secrets.RDS_INSTANCE_INT }} # RDS DNS/Name
DATABASE_URL: ${{ secrets.DB_CONNECTION_INT }} # The entire connection string, including the RDS DNS, username, password and database
deploy_api:
name: Deploy API
runs-on: ubuntu-latest
needs: migrate_db
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Configure aws credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
role-session-name: github-actions-deploy-int
aws-region: ${{ secrets.AWS_DEFAULT_REGION }}
- name: Install dependencies
working-directory: ./api
run: |
PRISMA_ENGINE='["rhel-openssl-3.0.x"]' npm ci
npm i -g [email protected]
- name: Build Api
working-directory: ./api
run: |
npm run type
npm run build
- name: Deploy serverless app
working-directory: ./api
run: |
export SERVERLESS_LICENSE_KEY=`aws ssm get-parameter --name ${{ secrets.SERVERLESS_LICENSE_KEY_SSM_PARAMETER_ARN }} --query "Parameter.Value" --output text`
npm run deploy:int