change branch from main to dev in deploy.yml #12
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: Deployment on dev server | |
on: | |
push: | |
branches: | |
- dev | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: pull code and restart service | |
uses: appleboy/ssh-action@master | |
env: | |
SERVER_WORKDIR: ${{secrets.SERVER_WORKDIR}} | |
with: | |
host: ${{secrets.SERVER_HOST}} | |
username: ${{secrets.SERVER_USERNAME}} | |
key: ${{secrets.SERVER_KEY}} | |
envs: SERVER_WORKDIR | |
script_stop: true | |
script: | | |
cd $SERVER_WORKDIR | |
echo "pulling code from remote..." | |
git checkout . | |
git pull github main | |
echo "pulling completed successfully." | |
kill -HUP 20504 | |
echo "service restarted successfully." | |