Skip to content

feat: 요청받은 mp3 파일을 텍스트로 변환하는 stt 기능 구현 #14

feat: 요청받은 mp3 파일을 텍스트로 변환하는 stt 기능 구현

feat: 요청받은 mp3 파일을 텍스트로 변환하는 stt 기능 구현 #14

Workflow file for this run

name: CI/CD with FastAPI
on:
pull_request:
branches: ["main"]
push:
branches: ["main"]
workflow_dispatch:
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
env:
IMAGE: ${{ secrets.DOCKER_USERNAME }}/talky-ai
COMPOSE_FILE: docker-compose.yml
jobs:
docker-build-push:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build & Push Docker Image
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
push: true
no-cache: true
tags: |
${{ env.IMAGE }}:latest
${{ env.IMAGE }}:${{ github.sha }}
deploy:
name: Deploy to Server
needs: docker-build-push
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
# docker-compose.yml 파일을 서버로 복사
- name: Copy docker-compose.yml to server
uses: appleboy/scp-action@master
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USER }}
key: ${{ secrets.SERVER_SSH_KEY }}
source: "${{ env.COMPOSE_FILE }}"
target: "/home/${{ secrets.SERVER_USER }}/"
# SSH로 접속해 docker-compose로 배포
- name: Deploy with Docker Compose
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USER }}
key: ${{ secrets.SERVER_SSH_KEY }}
script: |
cd /home/${{ secrets.SERVER_USER }}/
echo "${{ secrets.ENV_FILE }}" > .env
echo "DOCKER_USERNAME=${{ secrets.DOCKER_USERNAME }}" >> .env
echo "[1/2] Pull latest Docker image for FastAPI service..."
docker compose -f ${{ env.COMPOSE_FILE }} pull fastapi
echo "[2/2] Restart FastAPI service with new image..."
docker compose -f ${{ env.COMPOSE_FILE }} up -d --no-deps --force-recreate fastapi
docker image prune -af || true