fix: enhance prod deploy #10
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-Pre | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
deploy-to-server: | |
runs-on: ubuntu-latest | |
steps: | |
- name: SSH into server and execute deployment script | |
env: | |
PRE_HOST: ${{ secrets.PRE_HOST }} | |
PRE_USER: ${{ secrets.PRE_USER }} | |
PRE_PWD: ${{ secrets.PRE_PWD }} | |
DEPLOY_PATH: ${{ secrets.DEPLOY_PATH }} | |
run: | | |
sshpass -p "$PRE_PWD" ssh -o StrictHostKeyChecking=no $PRE_USER@$PRE_HOST << EOF | |
set -e | |
export PATH="/root/miniconda3/bin:\$PATH" | |
source /root/miniconda3/etc/profile.d/conda.sh | |
conda activate osgraph-env | |
cd $DEPLOY_PATH | |
echo "Update master branch" | |
git checkout master | |
git pull origin master | |
echo "Build OSGraph" | |
bash ./bin/build.sh | |
echo "Start OSGraph" | |
bash ./bin/start.sh prod | |
EOF |