Merge pull request #219 from RieCo432/dev #39
This file contains hidden or 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: Server Update | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
ssh-login: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up SSH key | |
uses: webfactory/[email protected] | |
with: | |
ssh-private-key: ${{ secrets.RASPI5_SSH_PRIVATE_KEY }} | |
- name: SSH into server, pull, build and restart service | |
run: | | |
ssh -o StrictHostKeyChecking=no [email protected] -p 2222 << 'EOF' | |
cd /var/www/becycle-mx | |
git pull | |
sudo docker-compose build | |
sudo systemctl restart becycle-mx | |
EOF |