demo site deploy #94
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: demo site deploy | |
on: | |
workflow_dispatch | |
# pull_request: | |
# branches: [ "main" ] | |
# push: | |
# branches: [ "main" ] | |
jobs: | |
build-and-deploy: | |
runs-on: self-hosted | |
defaults: | |
run: | |
working-directory: /home/ubuntu/rd/project/deeptest | |
steps: | |
- name: checkout backend codes | |
run: git pull | |
- name: checkout frontend codes | |
run: git pull | |
working-directory: /home/ubuntu/rd/project/deeptest-ui | |
- name: make server | |
run: ENV=dp make compile_server_linux | |
- name: make agent | |
run: ENV=dp make compile_agent_linux | |
- name: make ui | |
run: make compile_ui_demo | |
- name: copy files | |
run: | | |
cp -f bin/linux/deeptest-server /home/ubuntu/rd/server/ | |
cp -f client/bin/linux/deeptest-agent /home/ubuntu/rd/server/ | |
rm -rf /home/ubuntu/rd/server/deeptest-ui | |
cp -fr client/ui /home/ubuntu/rd/server/deeptest-ui | |
- name: start service | |
run: | | |
ps -ef | grep 'deeptest-' | grep -v grep | awk '{print $2}' | xargs --no-run-if-empty kill -9 | |
cd /home/ubuntu/rd/server | |
RUNNER_TRACKING_ID="" && nohup ./deeptest-server > server.log 2>&1 & | |
RUNNER_TRACKING_ID="" && export DemoTestSite=http://111.231.16.35:9000 && nohup ./deeptest-agent > agent.log 2>&1 & |