Skip to content

Merge pull request #21 from t1nyb0x/develop #1

Merge pull request #21 from t1nyb0x/develop

Merge pull request #21 from t1nyb0x/develop #1

Workflow file for this run

name: deploy to vps
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup SSH
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
SSH_KNOWN_HOSTS: ${{ secrets.SSH_KNOWN_HOSTS }}
run: |
mkdir -p ~/.ssh/
echo "$SSH_PRIVATE_KEY" > ~/.ssh/deploy_key
chmod 600 ~/.ssh/deploy_key
echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
- name: Restart Application
env:
SSH_USER: ${{ secrets.SSH_USER }}
VPS_HOST: ${{ secrets.VPS_HOST }}
SSH_PORT: ${{ secrets.SSH_PORT }}
run: |
ssh -o StrictHostKeyChecking=no -i ~/.ssh/deploy_key $SSH_USER@$VPS_HOST -p $SSH_PORT 'cd replyvxtwitter && git pull origin && docker compose up -d --build'