ci: 移除远程部署 job
API 已作为底包打进 rustdesk-server 的 s6 一体镜像,由容器内 s6 api 服务拉起,不再单独部署
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
name: CI and Docker Build
|
||||
|
||||
# 本仓库只构建并推送镜像,不做远程部署:
|
||||
# git.viaeon.com/admin/rustdesk-api:latest 作为底包被 rustdesk-server 的 s6 一体镜像引用
|
||||
# (见 admin/rustdesk-server 的 Dockerfile.ci),API 由该容器内的 s6 api 服务拉起
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
@@ -89,40 +93,3 @@ jobs:
|
||||
docker push git.viaeon.com/admin/rustdesk-api:${{ github.ref_name }} 2>&1
|
||||
echo "Pushing latest..."
|
||||
docker push git.viaeon.com/admin/rustdesk-api:latest 2>&1
|
||||
|
||||
deploy:
|
||||
name: Deploy to Remote Server
|
||||
runs-on: ubuntu
|
||||
needs: docker
|
||||
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
|
||||
env:
|
||||
RUNNER_TOOL_CACHE: /toolcache
|
||||
|
||||
steps:
|
||||
- name: Install SSH Client
|
||||
run: |
|
||||
if command -v apk &> /dev/null; then
|
||||
apk add --no-cache openssh-client sshpass
|
||||
elif command -v apt-get &> /dev/null; then
|
||||
apt-get update && apt-get install -y openssh-client sshpass
|
||||
else
|
||||
echo "Cannot install sshpass"
|
||||
exit 1
|
||||
fi
|
||||
ssh -V
|
||||
|
||||
- name: Deploy via SSH
|
||||
run: |
|
||||
sshpass -p '${{ secrets.DEPLOY_PASSWORD }}' ssh -o StrictHostKeyChecking=no -p ${{ secrets.DEPLOY_PORT || '22' }} ${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST }} << ENDSSH
|
||||
set -e
|
||||
cd "${{ secrets.DEPLOY_PATH }}"
|
||||
echo "Current directory: \$(pwd)"
|
||||
echo "Pulling latest image..."
|
||||
docker pull git.viaeon.com/admin/rustdesk-api:latest
|
||||
echo "Restarting containers..."
|
||||
docker compose down || true
|
||||
docker compose up -d
|
||||
echo "Cleaning up old images..."
|
||||
docker image prune -f
|
||||
echo "Deployment completed!"
|
||||
ENDSSH
|
||||
|
||||
Reference in New Issue
Block a user