Skip to content

Deploy to Production #7

Deploy to Production

Deploy to Production #7

Workflow file for this run

name: Deploy to Production
on:
workflow_run:
workflows: ["Build and Push"]
types:
- completed
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
# Запускаємо ТІЛЬКИ якщо збірка пройшла успішно
if: ${{ github.event.workflow_run.conclusion == 'success' }}
env:
SERVER_HOST: ${{ secrets.SERVER_HOST }}
SERVER_USER: ${{ secrets.SERVER_USER }}
SERVER_SSH_KEY: ${{ secrets.SERVER_SSH_KEY }}
steps:
- name: Execute SSH deployment script
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ env.SERVER_HOST }}
username: ${{ env.SERVER_USER }}
key: ${{ env.SERVER_SSH_KEY }}
script: |
cd ~/SEROTONIN_SCRIPT
git pull origin main
bash scripts/deploy.sh