-
Notifications
You must be signed in to change notification settings - Fork 1
33 lines (32 loc) · 1.26 KB
/
ci-cd-pipeline.yaml
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
name: CI/CD Pipeline
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout head
uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: "3.9"
- name: Test with unittest
run: |
cd server
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements-test.txt
cd ..
python -m unittest
- name: AWS build and deploy
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-west-2
- run: cd server && sam build && cd .aws-sam/build/FlatiniFunction && rm -fr clean-build.sh samconfig.toml template.yaml requirements.txt requirements-test.txt tests
- run: cd server && sam deploy --no-fail-on-empty-changeset --no-confirm-changeset --stack-name flatini-api-prod --s3-bucket flatini-api-prod-s3 --region eu-west-2 --capabilities CAPABILITY_IAM --parameter-overrides ${{ secrets.SAM_PARAMETER_OVERRIDES }}