add action

This commit is contained in:
Oleg Oleg 2025-12-25 01:07:20 +04:00
parent b2c0604f5c
commit eb92283977

View File

@ -0,0 +1,23 @@
name: deploy
on:
push:
branches: [ "main" ]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Deploy via SSH
env:
DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }}
DEPLOY_USER: ${{ secrets.DEPLOY_USER }}
DEPLOY_SSH_KEY: ${{ secrets.DEPLOY_SSH_KEY }}
DEPLOY_PATH: ${{ secrets.DEPLOY_PATH }}
run: |
set -euo pipefail
install -m 700 -d ~/.ssh
echo "${DEPLOY_SSH_KEY}" > ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519
ssh -o StrictHostKeyChecking=no "${DEPLOY_USER}@${DEPLOY_HOST}" \
"cd '${DEPLOY_PATH}' && git pull && ./new_version.sh"