This repository has been archived by the owner on Oct 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
108 lines (80 loc) · 3.17 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# yaml-language-server: $schema=https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/github-workflow.json
---
name: Deploy CloudFormation stacks and production environment
on:
push:
branches:
- main
permissions:
id-token: write
contents: read
deployments: write
pull-requests: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
ACCOUNT_ID: ${{ secrets.ACCOUNT_ID }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_REGION: us-east-1
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
CERTIFICATE_ARN: ${{ secrets.CERTIFICATE_ARN }}
DATABASE_URL: ${{ secrets.DATABASE_URL_PRODUCTION }}
DATABASE_URL_REGISTRAR_SCRAPER: ${{ secrets.DATABASE_URL_REGISTRAR_SCRAPER }}
DATABASE_URL_WEBSOC_SCRAPER: ${{ secrets.DATABASE_URL_WEBSOC_SCRAPER }}
HOSTED_ZONE_ID: ${{ secrets.HOSTED_ZONE_ID }}
NODE_ENV: production
jobs:
deploy-api:
name: Deploy API CloudFormation stack and production environment
runs-on: ubuntu-latest
environment:
name: production
url: https://api-next.peterportal.org
steps:
- name: Checkout repository
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
- name: Setup Node.js and pnpm
uses: ./.github/actions/setup-node-and-pnpm
- name: Install dependencies
# Ensure NODE_ENV != production so pnpm will install devDependencies!!!
run: NODE_ENV=development pnpm install --frozen-lockfile
- name: Build API
run: pnpm build --filter="@apps/api"
- name: Deploy API CloudFormation stack
run: pnpm --filter="@apps/api" cdk-app deploy
deploy-documentation:
name: Deploy documentation CloudFormation stack and production environment
runs-on: ubuntu-latest
environment:
name: production-docs
url: https://docs.api-next.peterportal.org
steps:
- name: Checkout repository
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
- name: Setup Node.js and pnpm
uses: ./.github/actions/setup-node-and-pnpm
- name: Install dependencies
# Ensure NODE_ENV != production so pnpm will install devDependencies!!!
run: NODE_ENV=development pnpm install --frozen-lockfile
- name: Build documentation
run: pnpm build --filter="@apps/docs"
- name: Deploy documentation CloudFormation stack
run: pnpm --filter="@tools/cdk" docs deploy
deploy-services:
name: Deploy services CloudFormation stack and production environment
runs-on: ubuntu-latest
environment:
name: production-services
steps:
- name: Checkout repository
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
- name: Setup Node.js and pnpm
uses: ./.github/actions/setup-node-and-pnpm
- name: Install dependencies
# Ensure NODE_ENV != production so pnpm will install devDependencies!!!
run: NODE_ENV=development pnpm install --frozen-lockfile
- name: Build services
run: pnpm build --filter="@services/*"
- name: Deploy stack
run: pnpm --filter="@tools/cdk" services deploy