deadline_bot/.github/workflows/deploy.yml
2025-02-16 16:43:33 +03:00

27 lines
No EOL
603 B
YAML

name: Deploy to Server
on:
push:
branches:
- deploy
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Add SSH key
uses: webfactory/ssh-agent@v0.7.0
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Deploy to server
run: |
ssh -o StrictHostKeyChecking=no ${{ secrets.USERNAME }}@${{ secrets.SERVER_IP }} "
cd ${{ secrets.PROJECT_PATH }} &&
git fetch origin deploy &&
git reset --hard origin/deploy
"