-
Notifications
You must be signed in to change notification settings - Fork 1
61 lines (52 loc) · 1.57 KB
/
deploy-aws.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
name: Deploy Scanner to AWS
on:
workflow_call:
inputs:
environment:
description: 'Deployment environment'
required: true
type: string
provisionedConcurrency:
description: 'Provisioned concurrency'
required: true
type: number
checkoutBranch:
description: 'Branch to checkout code from'
required: true
type: string
permissions:
id-token: write
contents: read
jobs:
virus-scanner:
name: virus scanner serverless
runs-on: ubuntu-latest
steps:
- name: Checkout source code from specified checkout branch
uses: actions/checkout@v3
with:
ref: ${{ inputs.checkoutBranch }}
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
- name: Cache Node.js modules
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.OS }}-node-scanner-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-node-scanner-
${{ runner.OS }}-node-
- name: Configure AWS credentials
uses: aws-actions/[email protected]
with:
role-to-assume: ${{ secrets.AWS_CI_ROLE_TO_ASSUME }}
aws-region: ${{ secrets.AWS_DEFAULT_REGION }}
- name: Install node dependencies
run: npm ci
- name: Deploy with Serverless Framework
env:
ENV: ${{ inputs.environment }}
CONCURRENCY: ${{ inputs.provisionedConcurrency }}
run: npm run deploy