name: Deploy to Development on: push: branches: - development jobs: deploy: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 with: fetch-depth: 0 - name: Setup SSH uses: webfactory/ssh-agent@v0.9.0 with: ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} - name: Add VPS to known_hosts run: | mkdir -p ~/.ssh ssh-keyscan -H ${{ secrets.VPS_HOST }} >> ~/.ssh/known_hosts - name: Push to VPS run: | git remote remove vps || true git remote add vps git@${{ secrets.VPS_HOST }}:/home/git/repos/backend-development.git git push vps HEAD:development --force