-
Notifications
You must be signed in to change notification settings - Fork 2
80 lines (66 loc) · 1.88 KB
/
deploy-zap-dev.yaml
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
name: Deployment and ZAP scan - DEV
on:
workflow_dispatch:
push:
tags:
- dev
env:
ENV_NAME: dev
jobs:
deploy:
runs-on: ubuntu-latest
timeout-minutes: 10
concurrency: ci-${{ github.ref }}-dev
environment:
name: dev
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Cache yarn
uses: actions/cache@v3
with:
path: ./.yarn/cache
key: pcc-backend
restore-keys: pcc-backend
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
role-skip-session-tagging: true
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY_ID }}
aws-region: ca-central-1
role-to-assume: ${{ secrets.AWS_SA_ROLE_ARN }}
role-duration-seconds: 900
role-session-name: ci-dev-deployment
- name: Install dependencies
run: yarn
- name: Setup ENV file
run: cp ./.config/.env.example ./.env
- name: Build
run: make build-backend
- name: Upload build artifacts
run: make aws-upload-artifacts
- name: Deploy migrations
run: make aws-deploy-migrator
- name: Run migrations
run: make aws-run-migrator
- name: Deploy All
run: make aws-deploy-all
zap_scan:
name: ZAP baseline scan
needs: deploy
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v3
- name: ZAP baseline scan
uses: zaproxy/action-baseline@v0.4.0
with:
target: ${{ secrets.ZAP_API_URL }}
cmd_options: '-I'
- name: Upload ZAP report as artifact
uses: actions/upload-artifact@v3
with:
name: OWASP ZAP CCFP Backend Report
path: report_html.html