Repository navigation
executable file
·76 lines (62 loc) · 2.49 KB
/
Copy pathdev.yml
File metadata and controls
executable file
·76 lines (62 loc) · 2.49 KB
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
#
# Github Actions for Serverless Framework
#
# Create AWS_KEY and AWS_SECRET secrets in Github repository settings
# If you're using env.yml file, store its content as ENV Github secret
#
# Master branch will be deployed as DEV and every new tag starting with "v**" (e.g. v1.0, v1.2, v2.0, etc) will be deployed as PROD
#
# Learn more: https://maxkostinevich.com/blog/how-to-deploy-serverless-applications-using-github-actions/
#
name: Deploy Dev
on:
# push:
# branches:
# - main
workflow_dispatch:
jobs:
deploy-dev:
runs-on: ubuntu-latest
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
contents: write
steps:
- uses: actions/checkout@v4
- name: Setup NodeJS 18
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install Serverless Framework
run: npm install -g serverless
- name: Serverless AWS authentication
run: sls config credentials --provider aws --key ${{ secrets.AWS_KEY }} --secret ${{ secrets.AWS_SECRET }}
# The following commands needed for local installation only
# - name: Install Python Requirements plugin
# run: sls plugin install -n serverless-python-requirements
# - name: Install Warmup plugin
# run: sls plugin install -n serverless-plugin-warmup
# - name: Install API Gateway Throttling plugin
# run: sls plugin install -n serverless-api-gateway-throttling
- name: Install plugins
run: npm install
- name: Deploy Lambda functions
run: sls deploy
- name: Export Endpoint URL
run: echo $(sls info --verbose | grep endpoint | sed s/endpoint\:\ //g | awk '{print $1}') > endpoint
- name: Echo Endpoint URL
run: echo $(cat endpoint)
- name: Test Lambda functions
run: "curl -X POST -H 'Content-Type: multipart/form-data' -F 'file=@breathing.txt' $(cat endpoint)split"
#- name: Setup Python
# uses: actions/setup-python@v4
# with:
# python-version: "3.11"
#- name: Install dependencies
# run: pip install --no-cache-dir -r requirements.txt
#- name: Create deploy-requirements.txt
# run: pip freeze > deploy-requirements.txt
#- name: Commit and push deploy-requirements.txt
# uses: stefanzweifel/git-auto-commit-action@v4.16.0
# with:
# commit_message: "chore: updated deploy-requirements.txt"