-
Notifications
You must be signed in to change notification settings - Fork 0
31 lines (28 loc) · 847 Bytes
/
deploy.yml
File metadata and controls
31 lines (28 loc) · 847 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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