Skip to content

deploy

deploy #25

Workflow file for this run

name: deploy
on:
workflow_run:
workflows: [release]
branches: [main]
types:
- completed
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 TwitterRX && docker compose pull && docker compose down && docker compose up -d'