Skip to content

Commit 1ff5f2a

Browse files
authored
Merge pull request #190 from Pseudo-Lab/deploy-getcloser
ci(getcloser): add GitHub Actions auto-deploy workflow
2 parents f969a56 + 0ac44d2 commit 1ff5f2a

2 files changed

Lines changed: 53 additions & 5 deletions

File tree

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Deploy GetCloser
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
# 같은 브랜치 동시 실행 시 이전 잡 취소(경쟁 배포 방지)
10+
concurrency:
11+
group: cert-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
# ========================================
16+
# 🚀 Deploy GetCloser Service
17+
# ========================================
18+
deploy-prod:
19+
if: github.ref_name == 'main'
20+
name: 🚀 Deploy GetCloser
21+
runs-on: oracle
22+
environment: getcloser
23+
defaults:
24+
run:
25+
working-directory: ./getcloser
26+
27+
steps:
28+
- name: Checkout branch
29+
uses: actions/checkout@v3
30+
31+
- name: Set up Docker Buildx
32+
uses: docker/setup-buildx-action@v3
33+
34+
- name: Create .env file for PROD
35+
run: |
36+
set -e
37+
echo "DB_USER=${{ secrets.DB_USER }}" > .env
38+
echo "DB_PASSWORD=${{ secrets.DB_PASSWORD }}" >> .env
39+
echo "DB_DATABASE=${{ vars.DB_DATABASE }}" >> .env
40+
echo "APP_HOST=${{ vars.APP_HOST }}" >> .env
41+
42+
- name: 🚀 Deploy to PROD
43+
run: |
44+
docker compose -f docker-compose.yaml -p getcloser-${{ github.ref_name }} down --remove-orphans || true
45+
docker compose -f docker-compose.yaml -p getcloser-${{ github.ref_name }} up -d --build

getcloser/.env.example

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
FRONTEND_PORT=8080
2-
BACKEND_PORT=8000
1+
# === Database Config ===
32
DB_USER=user
43
DB_PASSWORD=password
54
DB_DATABASE=app_db
6-
SECRET_KEY=secret_key
7-
ACCESS_TOKEN_EXPIRE_MINUTES=60
8-
APP_HOST=www.example.com
5+
6+
# === Auth (currently unused) ===
7+
# SECRET_KEY=secret_key
8+
# ACCESS_TOKEN_EXPIRE_MINUTES=60
9+
10+
# === App Host ===
11+
APP_HOST=localhost

0 commit comments

Comments
 (0)