-
Notifications
You must be signed in to change notification settings - Fork 2
50 lines (42 loc) · 1.38 KB
/
deploy_backend.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 to AWS Elastic Beanstalk
on:
push:
branches:
- main
paths:
- 'backend/**'
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: iamlogand
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Replace placeholder with Docker image tag
run: |
sed -i "s/\${TAG}/${{ github.run_number }}/g" backend/docker-compose.yml
- name: Build and push Docker image
id: docker_build
uses: docker/build-push-action@v2
with:
context: backend
push: true
tags: iamlogand/republic-of-rome-online-backend:rorsite-build-${{ github.run_number }}
- name: Zip the application files
run: |
cd backend
zip -r ../app.zip .
- name: Deploy to Elastic Beanstalk
uses: einaregilsson/beanstalk-deploy@v20
with:
aws_access_key: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
application_name: republic-of-rome-online-backend
environment_name: republic-of-rome-online-backend-env
version_label: rorsite-build-${{ github.run_number }}
region: eu-west-2
deployment_package: app.zip