Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and Deploy Docker Image
name: Deploy Doddle WAS

on:
workflow_dispatch: {}
Expand All @@ -8,22 +8,22 @@ on:

jobs:
build-and-deploy:
runs-on: self-hosted # 로컬 Ubuntu의 actions 계정에서 실행됨
runs-on: self-hosted

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Build and tag Docker image
run: |
docker build --no-cache -t kws_be:latest .
docker build --no-cache -t doddle_be_deploy:latest .

- name: Deploy container locally
run: |
IMAGE=kws_be:latest
docker stop KWS_BE || true
docker rm KWS_BE || true
docker run -d --name KWS_BE -p 25121:8000 \
IMAGE=doddle_be_deploy:latest
docker stop BE_Deploy || true
docker rm BE_Deploy || true
docker run -d --name BE_Deploy -p 25121:8000 \
-e DATABASE_BACKEND=${{ secrets.DATABASE_BACKEND }} \
-e DATABASE_CON2BACK=${{ secrets.DATABASE_CON2BACK }} \
-e JWT_SECRET=${{ secrets.JWT_SECRET }} \
Expand All @@ -38,4 +38,4 @@ jobs:
-e CONTROL_HOST=${{ secrets.CONTROL_HOST }} \
-e CONTROL_PORT=${{ secrets.CONTROL_PORT }} \
$IMAGE
docker system prune -af
docker system prune -af
41 changes: 41 additions & 0 deletions .github/workflows/dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: DEV Deploy Doddle WAS

on:
workflow_dispatch: {}
push:
branches:
- dev

jobs:
build-and-deploy:
runs-on: self-hosted

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Build and tag Docker image
run: |
docker build --no-cache -t doddle_be_dev:latest .

- name: Deploy container locally
run: |
IMAGE=doddle_be_dev:latest
docker stop BE_DEV || true
docker rm BE_DEV || true
docker run -d --name BE_DEV -p 25122:8000 \
-e DATABASE_BACKEND=${{ secrets.DATABASE_BACKEND }} \
-e DATABASE_CON2BACK=${{ secrets.DATABASE_CON2BACK }} \
-e JWT_SECRET=${{ secrets.JWT_SECRET }} \
-e JWT_REFRESH_SECRET=${{ secrets.JWT_REFRESH_SECRET }} \
-e REDIS_HOST=${{ secrets.REDIS_HOST }} \
-e REDIS_PORT=${{ secrets.REDIS_PORT }} \
-e REDIS_PASSWORD=${{ secrets.REDIS_PASSWORD }} \
-e SMTP_SERVER=${{ secrets.SMTP_SERVER }} \
-e SMTP_PORT=${{ secrets.SMTP_PORT }} \
-e SENDER_EMAIL=${{ secrets.SENDER_EMAIL }} \
-e SENDER_PASSWORD=${{ secrets.SENDER_PASSWORD }} \
-e CONTROL_HOST=${{ secrets.CONTROL_HOST }} \
-e CONTROL_PORT=${{ secrets.CONTROL_PORT }} \
$IMAGE
docker system prune -af