Skip to content

Commit

Permalink
cicd: fix variable invalid by dash
Browse files Browse the repository at this point in the history
  • Loading branch information
hoang-rio committed Nov 26, 2024
1 parent 76eacaf commit f8d7811
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/deploy_with_git.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ jobs:
- uses: actions/checkout@v3
- name: Deploy with git
run: |
SSH_COMAND-DEPLOY="cd ${{secrets.SSH_DEPLOY_PATH}} && git pull"
SSH_COMAND_DEPLOY="cd ${{secrets.SSH_DEPLOY_PATH}} && git pull"
HAS_PYTHON_CHANGE=true
GIT_CHANGED_FILE=$(git show --name-only)
if [[ $(echo $GIT_CHANGED_FILE | grep ".py") == "" ]]; then
HAS_PYTHON_CHANGE=false
fi
if [[ $HAS_PYTHON_CHANGE == true ]]; then
SSH_COMAND-DEPLOY="$SSH_COMAND-DEPLOY && kill $(ps | grep app.py | grep -v grep | awk '{print $2}') && nohup python app.py &"
SSH_COMAND_DEPLOY="$SSH_COMAND_DEPLOY && kill $(ps | grep app.py | grep -v grep | awk '{print $2}') && nohup python app.py &"
fi
ssh -i ${{env.SSH_KEY_FILE_PATH}} ${{secrets.SSH_DEPLOY_USER}}@${{secrets.SSH_DEPLOY_HOST}} "$SSH_COMAND-DEPLOY"
ssh -i ${{env.SSH_KEY_FILE_PATH}} ${{secrets.SSH_DEPLOY_USER}}@${{secrets.SSH_DEPLOY_HOST}} "$SSH_COMAND_DEPLOY"
- name: Clean deploy key file
run: rm -rf ${{env.SSH_KEY_FILE_PATH}}

0 comments on commit f8d7811

Please sign in to comment.