Update README.md #44
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 and Build/Run App on Remote Server | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup SSH | |
uses: webfactory/[email protected] | |
with: | |
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
- name: Install rsync | |
run: sudo apt-get install -y rsync | |
- name: Copy files via rsync | |
run: | | |
rsync -avz -e "ssh -o StrictHostKeyChecking=no" ./ azureuser@${{ secrets.REMOTE_SERVER_IP }}:/home/azureuser/mawruth | |
build-and-run: | |
needs: deploy | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup SSH | |
uses: webfactory/[email protected] | |
with: | |
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
- name: Execute build and run commands | |
run: | | |
ssh -o StrictHostKeyChecking=no azureuser@${{ secrets.REMOTE_SERVER_IP }} 'cd /home/azureuser/mawruth && make kill && make build && make run-bg' |