-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (51 loc) · 2.12 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
54
55
56
57
58
59
60
name: Deploy to ECR and Elastic Beanstalk
on:
push:
branches: [ main ]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Configure AWS credentials
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: ap-northeast-2
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: Build and push Docker images to ECR
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
run: |
# Build and Push Backend Image
docker build -t $ECR_REGISTRY/community-backend:latest -f backend/dockerfile ./backend
docker push $ECR_REGISTRY/community-backend:latest
# Build and Push Frontend Image
docker build -t $ECR_REGISTRY/community-frontend:latest -f frontend/dockerfile ./frontend
docker push $ECR_REGISTRY/community-frontend:latest
- name: Deploy Backend to Elastic Beanstalk!
uses: einaregilsson/beanstalk-deploy@v21
with:
aws_access_key: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
application_name: david-kakao-community
environment_name: David-kakao-community-env-backend
version_label: "backend-${{ github.sha }}-${{ github.run_number }}"
region: ap-northeast-2
deployment_package: backend/Dockerrun.aws.json
wait_for_environment_recovery: 300
- name: Deploy Frontend to Elastic Beanstalk
uses: einaregilsson/beanstalk-deploy@v21
with:
aws_access_key: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
application_name: david-kakao-community
environment_name: David-kakao-community-env-front
version_label: "frontend-${{ github.sha }}-${{ github.run_number }}"
region: ap-northeast-2
deployment_package: frontend/Dockerrun.aws.json
wait_for_environment_recovery: 300