-
Notifications
You must be signed in to change notification settings - Fork 32
59 lines (52 loc) · 2.11 KB
/
upload_lambda.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
name: Deployment of Online DevOps Dojo coach lambda
on:
push:
# change(s) on those files trigger this pipeline
paths: ['*.js', 'package*.json', 'serverless.yml', '.github/workflows/upload_lambda.yml']
branches: ['master']
jobs:
build:
timeout-minutes: 10
runs-on: ubuntu-20.04
steps:
- name: Copy the repository
uses: actions/checkout@v2
# Node 12 included in LTS ubuntu-20.04 matches the version used for AWS Lambda
# (https://github.com/actions/virtual-environments/blob/master/images/linux/Ubuntu2004-README.md)
# hence comment the upgrade code for now
# - name: Check Node 12
# uses: actions/setup-node@v1.4.2
# with:
# node-version: 12
# not supported yet for issue_comment event
# - name: Cache node modules
# uses: actions/cache@v2
# env:
# cache-name: cache-node-modules
# with:
# path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS
# key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
# restore-keys: |
# ${{ runner.os }}-build-${{ env.cache-name }}-
# ${{ runner.os }}-build-
# ${{ runner.os }}-
# Install nodejs packages listed in package-lock.json.
# - if: github.base_ref == 'master'
- name: Install node modules
run: npm ci --only=prod --no-fund
# - if: github.base_ref == 'master'
# run "serverless deploy --verbose" in a docker container and run the config file serverless.yml
- name: Deploy lambda
uses: serverless/github-action@v2.1.0
env: # all mandatory
# AWS
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_KEY }}
AWS_REGION: ${{ secrets.AWS_REGION }}
AWS_STAGE: ${{ secrets.AWS_STAGE }}
# GITHUB APP
APP_ID: ${{ secrets.APP_ID }}
WEBHOOK_SECRET: ${{ secrets.WEBHOOK_SECRET }}
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
with:
args: deploy --verbose