Skip to content

Commit

Permalink
add hotfix workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
mulmuri committed Nov 7, 2023
1 parent 4106b00 commit 60e9865
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 1 deletion.
49 changes: 49 additions & 0 deletions .github/workflows/deploy.hotfix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Deploy Backend on Integration Server

on:
push:
branches:
- hotfix
- feature/cicd

env:
HOST: ${{ secrets.HOST }}
USERNAME: ${{ secrets.USERNAME }}
KEY: ${{ secrets.SSH_KEY }}
PORT: ${{ secrets.PORT }}
INSTANCE_PATH: ./backend-hotfix

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Test
run: |
echo "test is skipped"
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Send
uses: appleboy/scp-action@master
with:
host: ${{ env.HOST }}
username: ${{ env.USERNAME }}
key: ${{ env.KEY }}
port: ${{ env.PORT }}
source: "."
target: ${{ env.INSTANCE_PATH }}

- name: Deploy
uses: appleboy/ssh-action@master
with:
host: ${{ env.HOST }}
username: ${{ env.USERNAME }}
key: ${{ env.KEY }}
port: ${{ env.PORT }}
script: |
cd ${{ env.INSTANCE_PATH }}
make build-hotfix
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,8 @@ build-prod:

build-intg:
docker compose -p backend-intg -f ./deploy/docker-compose.intg.yml down
docker compose -p backend-intg -f ./deploy/docker-compose.intg.yml up --build -d
docker compose -p backend-intg -f ./deploy/docker-compose.intg.yml up --build -d

build-hotfix:
docker compose -p backend-hotfix -f ./deploy/docker-compose.hotfix.yml down
docker compose -p backend-hotfix -f ./deploy/docker-compose.hotfix.yml up --build -d
17 changes: 17 additions & 0 deletions deploy/docker-compose.hotfix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
services:
api:
container_name: prayhelper-server-hotfix
build:
context: ../
dockerfile: ./deploy/Dockerfile
image: prayhelper-server-hotfix
ports:
- "4008:5000"
volumes:
- ../:/app
environment:
FLASK_APP: app
APP_CONFIG_FILE: config/hotfixuction.py
FLASK_DEBUG: "false"
TZ: "Asia/Seoul"
command: ["python3", "-m", "flask", "run", "--host=0.0.0.0"]

0 comments on commit 60e9865

Please sign in to comment.