Merge branch 'main' of #35
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 Production Server | |
on: | |
push: | |
branches: | |
- main # Set this to whichever branches you want to trigger the deployment. | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up SSH key | |
uses: webfactory/[email protected] | |
with: | |
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
- name: Execute SSH commands | |
run: | | |
ssh -o "StrictHostKeyChecking=no" [email protected] " | |
echo 'Connected successfully'; | |
cd csci181s-course-project/; | |
git stash; | |
git pull; | |
sudo systemctl stop server.service; | |
sudo systemctl enable server.service; | |
sudo systemctl start server.service; | |
sudo systemctl status server.service; | |
" |