-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (59 loc) · 1.92 KB
/
deploy-stage.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
name: Deploy Stage
on:
workflow_run:
workflows: ["Version & Changelog"]
types:
- completed
env:
ENVIRONMENT: stage
jobs:
unit-test:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: "package.json"
- uses: ./.github/actions/cached-npm-install
- run: npm run build
- run: npm run lint:nofix
- run: npm run test
deploy:
needs: [unit-test]
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
matrix:
customer: ["cuckoo"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: "package.json"
- uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-west-2
- uses: ./.github/actions/cached-npm-install
- run: npm run package
- run: npx cdk diff --context CUSTOMER=${{ matrix.customer }} --context ENVIRONMENT=${{ env.ENVIRONMENT }}
- run: npx cdk deploy --context CUSTOMER=${{ matrix.customer }} --context ENVIRONMENT=${{ env.ENVIRONMENT }} --ci --require-approval=never --all
integration-test:
needs: [deploy]
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: "package.json"
- uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-west-2
- uses: ./.github/actions/cached-npm-install
- run: npm run test:integration:stage