Skip to content

docs:.github/deploy.yaml #2

docs:.github/deploy.yaml

docs:.github/deploy.yaml #2

Workflow file for this run

name: Deploy FastAPI
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up SSH
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Deploy to EC2
run: |
ssh -o StrictHostKeyChecking=no ${{ secrets.EC2_USER }}@${{ secrets.EC2_HOST }} << 'EOF'
cd /planner # FastAPI 프로젝트 디렉토리로 이동
git pull origin main
${{ secrets.USER_NAME }}
${{ secrets.PULL_KEY }}
cd /Controller
source myenv/bin/activate
pip install -r requirements.txt
uvicorn main:app --host 0.0.0.0 --port 1500 --reload &
EOF