Merge pull request #102 from CrawKatt/dev #38
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 Plantita Ayudante Bot | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup SSH | |
uses: webfactory/[email protected] | |
with: | |
ssh-private-key: ${{ secrets.SSH_KEY }} | |
- name: Deploy to VPS | |
run: | | |
ssh -o StrictHostKeyChecking=no -p ${{ secrets.SSH_PORT }} ${{ secrets.VPS_USER }}@${{ secrets.VPS_IP }} << 'EOF' | |
cd ~/plantita_ayudante | |
git pull | |
if ! cargo build --release; then | |
echo "Compilation failed, stopping deployment" | |
exit 1 | |
fi | |
cp -fu target/release/plantita_ayudante ~/plantita_ayudante/ | |
sudo systemctl restart plantita_ayudante.service | |
EOF |