Skip to content
Merged
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
32 changes: 32 additions & 0 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Deployment of FastAPI Book Project

on:
push:
branches:
- main

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python Env
uses: actions/setup-python@v3
with:
python-version: '3.10'

- name: Set up SSH agent
uses: webfactory/ssh-agent@v0.5.3
with:
ssh-private-key: ${{ secrets.SSH_KEY }}

- name: Deploy to Azure VM
run: |
ssh -o StrictHostKeyChecking=no blessing@${{ secrets.SEVER_IP }}
cd /home/blessing/fastapi-book-project
git pull origin main
source venv/bin/activate
pip install -r requirements.txt
sudo systemctl restart fastapi