-
Notifications
You must be signed in to change notification settings - Fork 2
/
amplify.yml
48 lines (45 loc) · 1.49 KB
/
amplify.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
version: 1
backend:
phases:
preBuild:
commands:
- sudo yum -y install jq
- jq --version
- npm i -g neonctl@v1
build:
commands:
- nvm use 18
- corepack enable
- pnpm install
# - npx amplify pipeline-deploy --branch $AWS_BRANCH --app-id $AWS_APP_ID
- |
if [ "${AWS_BRANCH}" = "main" ] || [ "${AWS_BRANCH}" = "dev" ]; then
pnpm amplify pipeline-deploy --branch $AWS_BRANCH --app-id $AWS_APP_ID
else
pnpm amplify generate config --branch main --app-id $AWS_APP_ID
fi
bash neon-ci.sh create-branch --app-id $AWS_APP_ID --neon-project-id <neon-project-id> --branch-name $AWS_BRANCH --parent-branch main --api-key-param "<ssm-param>" --role-name <neon-role> --database-name <neon-db-name> --suspend-timeout 0
postBuild:
commands:
- # EXAMPLE: only run the cleanup-branches command if you have tested
- |
if ! [ "${AWS_BRANCH}" = "main" ] && ! [ "${AWS_BRANCH}" = "dev" ]; then
# bash neon-ci.sh cleanup-branches --app-id $AWS_APP_ID --neon-project-id <neon-project-id> --api-key-param "<ssm-param>"
fi
cache:
paths:
- $(pnpm store path)
frontend:
phases:
preBuild:
commands:
- nvm use 18
- corepack enable
- npx --yes nypm i
build:
commands:
- npm run build
artifacts:
baseDirectory: .amplify-hosting
files:
- "**/*"