-
Notifications
You must be signed in to change notification settings - Fork 1
40 lines (38 loc) · 1.2 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
name: deploy to lambda
on:
push:
branches:
- master
jobs:
deploy:
name: deploy
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 14.x ]
steps:
- uses: jungwinter/split@v1
id: splitrepo
with:
msg: ${{ github.repository }}
seperator: '/'
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run build --if-present
- run: npm run test --if-present
- name: serverless deploy
uses: serverless/github-action@master
with:
args: deploy
env:
AWS_ACCESS_KEY_ID: ${{ secrets.SERVERLESS_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.SERVERLESS_AWS_SECRET_ACCESS_KEY }}
AWS_STORAGE_ARN: ${{ secrets.SERVERLESS_AWS_STORAGE_ARN }}
AWS_STORAGE_SG: ${{ secrets.SERVERLESS_AWS_STORAGE_SG }}
AWS_STORAGE_SUBNET: ${{ secrets.SERVERLESS_AWS_STORAGE_SUBNET }}
REPO_SECRETS_JSON: ${{ toJson(secrets) }}
GITHUB_REPO_NAME: ${{ steps.splitrepo.outputs._1 }}