generated from aws-samples/amplify-vite-react-template
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
amplify.yml
67 lines (67 loc) · 1.97 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
version: 1
test:
phases:
preTest:
commands:
- npm ci --verbose
- npm install -g pm2 --verbose
- npm install -g wait-on --verbose
- npm install mocha mochawesome --verbose
- npm install mochawesome-merge --verbose
- npm install -g mochawesome-report-generator --verbose
- pm2 start npm -- run dev
- wait-on http://localhost:5173
test:
commands:
- 'npx cypress run --reporter mochawesome --reporter-options
"reportDir=cypress/report/mochawesome-report,overwrite=false,html=false,json=true,timestamp=mmddyyyy_HHMMss"'
postTest:
commands:
- npx mochawesome-merge
cypress/report/mochawesome-report/mochawesome*.json >
cypress/report/mochawesome.json
- pm2 kill
artifacts:
baseDirectory: cypress
configFilePath: "**/mochawesome.json"
files:
- "**/*.png"
- "**/*.mp4"
backend:
phases:
build:
commands:
- npm ci --cache .npm --prefer-offline
- "echo $AWS_BRANCH"
- |
case "${AWS_BRANCH}" in
main)
echo "Deploying main branch..."
npx ampx pipeline-deploy --branch $AWS_BRANCH --app-id $AWS_APP_ID
;;
dev)
echo "Deploying dev branch..."
npx ampx pipeline-deploy --branch $AWS_BRANCH --app-id $AWS_APP_ID
;;
pr-*)
echo "Deploying pull request branch..."
npx ampx generate outputs --branch previews --app-id $AWS_APP_ID
;;
*)
echo "Deploying to staging branch..."
npx ampx generate outputs --branch dev --app-id $AWS_APP_ID
;;
esac
frontend:
phases:
build:
commands:
- npm run build
artifacts:
baseDirectory: dist
files:
- "**/*"
cache:
paths:
- .npm/**/*
- node_modules/**/*