-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (48 loc) · 1.7 KB
/
main.yml
File metadata and controls
61 lines (48 loc) · 1.7 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
name: Deploy AWS Lambda with Serverless
on:
push:
branches:
- main
- dev
pull_request:
branches:
- main # Run tests when merging to main and dev
- dev
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Verify Python installation
run: python --version
- name: Installing Requirements
run: pip install -r requirements.txt
- name: Triggering the run_checks using shell
run: sh run_checks.sh
- name: Install Serverless Framework
run: |
npm install -g [email protected]
serverless --version # Debugging: Check installed version
- name: Install Serverless Plugins
run: |
sls plugin install -n serverless-wsgi
sls plugin install -n serverless-python-requirements
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}
- name: Install only production dependencies
run: npm ci --only=production # Only production dependencies are deployed
- name: Installing the prune Plugin
run: npm install serverless-prune-plugin
- name: Deploy with Serverless
env:
SERVERLESS_ACCESS_KEY: ${{ secrets.SERVERLESS_ACCESS_KEY }}
run: serverless deploy