-
Notifications
You must be signed in to change notification settings - Fork 6
72 lines (72 loc) · 2.28 KB
/
main.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
name: workflow
on: [push, pull_request]
jobs:
job:
runs-on: ubuntu-latest
timeout-minutes: 30
services:
dynamodb:
image: amazon/dynamodb-local
ports:
- 8000:8000
# @note Github overwrites WORKDIR to repository path, so overwrite that again
options: >-
--workdir /home/dynamodblocal
--health-cmd "curl --fail http://127.0.0.1:8000/shell/ || exit 1" --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: '12'
# Client
- name: "[Client] Prepare"
working-directory: client
run: npm ci
- name: "[Client] Build"
working-directory: client
run: npm run build:prod
# Server
- name: "[Server] Prepare"
working-directory: server
run: npm ci
- name: "[Server] Lint"
working-directory: server
run: npm run lint
- name: "[Server] Test"
working-directory: server
run: npm test
env:
DYNAMO_TYPES_ENDPOINT: http://127.0.0.1:8000
- name: "[Server] Build"
working-directory: server
run: npm run build
- name: "[Server] Packaging"
working-directory: server
run: npm run pack
# Infra
- name: "[Infra] Prepare"
working-directory: infra
run: npm ci
- name: "[Infra] Lint"
working-directory: infra
run: npm run lint
- name: "[Infra] Test"
working-directory: infra
run: npm test
- name: "[Infra] Deploy"
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
uses: mooyoul/[email protected]
env:
AWS_DEFAULT_REGION: us-east-1
AWS_REGION: us-east-1
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
CDK_DEFAULT_ACCOUNT: ${{ secrets.CDK_DEFAULT_ACCOUNT }}
with:
group: poo-email
stream: ${{ github.sha }}-infra
retention: 30d
run: |
cd $GITHUB_WORKSPACE/infra
npm ci
npm run cdk -- deploy PooEmailServer PooEmailClient --ci --require-approval never