[IMP] show translated transcript button under summary #37
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: SSH Deployment | |
on: | |
push: | |
branches: [master] | |
workflow_dispatch: # Allows manual triggering | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Install SSH Key | |
run: | | |
mkdir -p ~/.ssh | |
echo "${{ secrets.SERVER_SSH_KEY }}" > ~/.ssh/deploy_key | |
chmod 600 ~/.ssh/deploy_key | |
ssh-keyscan -H ${{ secrets.SERVER_HOST }} >> ~/.ssh/known_hosts | |
- name: Deploy to server | |
env: | |
HOST: ${{ secrets.SERVER_HOST }} | |
USER: ${{ secrets.SERVER_USER }} | |
SCREEN_SESSION: ${{ secrets.SCREEN_SESSION }} | |
REPO_PATH: ${{ secrets.REPO_PATH }} | |
run: | | |
ssh -i ~/.ssh/deploy_key -o IdentitiesOnly=yes $USER@$HOST << EOF | |
# Send Ctrl+C to gracefully stop the process | |
screen -S $SCREEN_SESSION -X stuff $'\003' | |
# Wait for the process to stop | |
sleep 2 | |
# Pull latest changes | |
cd $REPO_PATH | |
git pull | |
# switch to the virtual environment | |
source .venv/bin/activate | |
# Update dependencies | |
pip install -r requirements.txt | |
# Run migrations | |
alembic upgrade head | |
# Restart the process | |
screen -S $SCREEN_SESSION -X stuff 'python bot.py\n' | |
EOF |