Skip to content

Commit

Permalink
直接部署服务
Browse files Browse the repository at this point in the history
  • Loading branch information
nasa1024 committed Jan 12, 2024
1 parent 81887c2 commit 928be36
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,19 @@ jobs:
file: ./Dockerfile
push: true
tags: evilharry1024/mouse-gaze:latest
- name: Install SSH client
run: |
sudo apt-get update
sudo apt-get install -y openssh-client
mkdir -p ~/.ssh
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -H ${{ secrets.IP }} >> ~/.ssh/known_hosts
- name: Deploy to Server
run: |
ssh ubuntu@${{ secrets.IP }} << 'EOF'
sudo docker stop rats mouse || true
sudo docker rm rats mouse || true
sudo docker run --name rats -d -p 8002:8000 -v /home/ubuntu/mousegaze/conf/config.ini:/app/conf/config.ini evilharry1024/mouse-gaze uvicorn cmd.rats.rats:app --host 0.0.0.0 --port 8000
sudo docker run --name mouse -d -p 8001:8000 -v /home/ubuntu/mousegaze/resource:/app/resource evilharry1024/mouse-gaze uvicorn cmd.mouse.mouse:app --host 0.0.0.0 --port 8000
EOF

0 comments on commit 928be36

Please sign in to comment.