Merge pull request #21 from t1nyb0x/develop #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |