8000 Create deploy.yml · BaseMax/github-actions-ssh-git-pull@ed22c9e · GitHub
[go: up one dir, main page]

Skip to content

Create deploy.yml

Create deploy.yml #1

Workflow file for this run

name: Deploy via SSH
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Set up SSH
uses: webfactory/ssh-agent@v0.9.0
with:
ssh-private-key: ${{ secrets.SSH_KEY }}
- name: Connect and Deploy
run: |
ssh -o StrictHostKeyChecking=no ${{ secrets.SSH_USERNAME }}@${{ secrets.SSH_HOST }} << 'EOF'
cd ${{ secrets.PROJECT_PATH }}
git pull origin main
pm2 restart 3
EOF
0