-
Notifications
You must be signed in to change notification settings - Fork 2
50 lines (42 loc) · 1.28 KB
/
deploy.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
name: Deploy API
on:
pull_request:
types:
- closed
branches: [main, development]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies
working-directory: backend
run: |
python -m pip install -r requirements.txt
# - name: Update config.json
# working-directory: backend
# run: |
# echo ${{ secrets.CHALICE_CONFIG_JSON }} > .chalice/config.json
- name: Set up AWS CLI
working-directory: backend
run: |
pip install awscli
aws configure set aws_access_key_id ${{ secrets.AWS_ACCESS_KEY_ID }}
aws configure set aws_secret_access_key ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws configure set default.region ${{ secrets.AWS_REGION }}
- name: Deploy Chalice App
working-directory: backend
run: |
if [ ${{ github.base_ref }} == 'main' ]; then
chalice deploy --stage prod
elif [ ${{ github.base_ref }} == 'development' ]; then
chalice deploy --stage dev
else
echo "No deployment for this branch"
exit 0
fi