Skip to content

refactor: four_pillar 모듈 구조 개선 (#27) #24

refactor: four_pillar 모듈 구조 개선 (#27)

refactor: four_pillar 모듈 구조 개선 (#27) #24

Workflow file for this run

name: CI/CD to NCP Server
on:
push:
branches:
- main
concurrency:
group: deploy-main
cancel-in-progress: true
jobs:
deploy:
runs-on: ubuntu-latest
timeout-minutes: 30
environment:
name: ncp-prod
url: https://www.satto.io.kr
steps:
- name: Checkout source code
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to NCP Container Registry
uses: docker/login-action@v3
with:
registry: satto-registry.kr.ncr.ntruss.com
username: ${{ secrets.NCP_REGISTRY_USERNAME }}
password: ${{ secrets.NCP_REGISTRY_PASSWORD }}
- name: Build and Push Docker Image (linux/amd64)
run: |
docker buildx build --platform linux/amd64 \
-t satto-registry.kr.ncr.ntruss.com/satto-server-fastapi:latest \
--push .
- name: Deploy to NCP Server
uses: appleboy/[email protected]
with:
host: ${{ secrets.NCP_SERVER_HOST }}
username: ${{ secrets.NCP_SERVER_USER }}
password: ${{ secrets.NCP_SERVER_PASSWORD }}
port: 22
script: |
set -e
cd /home/Satto-Server
# 최신 이미지로 fastapi만 갱신/재기동
docker compose -f docker-compose.dev.yml up -d --pull always fastapi
# 상태 확인
docker compose -f docker-compose.dev.yml ps fastapi
# 사용되지 않는 이미지 정리
docker system prune