-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (44 loc) · 1.37 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
51
52
53
name: Django CI/CD
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.10.12 # 사용할 Python 버전 선택
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run Tests
run: |
python manage.py test
- name: Upload to S3
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: |
aws s3 cp . s3://mutsa-s3-bucket/ --recursive --exclude "*" --include "mutsa.zip"
- name: Deploy to AWS CodeDeploy
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_APPLICATION_NAME: autodeploy
AWS_DEPLOYMENT_GROUP: autoDeployGroup
run: |
aws deploy create-deployment \
--application-name $AWS_APPLICATION_NAME \
--deployment-group-name $AWS_DEPLOYMENT_GROUP \
--file-exists-behavior OVERWRITE \
--s3-location bucket=mutsa-s3-bucket,bundleType=zip,key=mutsa.zip \
--region ap-northeast-2