This commit is contained in:
		
							parent
							
								
									8fbf05ed69
								
							
						
					
					
						commit
						04a8bcb484
					
				@ -64,15 +64,15 @@ jobs:
 | 
			
		||||
          build-args: |
 | 
			
		||||
            BUILDKIT_INLINE_CACHE=1
 | 
			
		||||
 | 
			
		||||
      # - name: 通过SSH部署到服务器
 | 
			
		||||
      #   if: ${{ steps.branch_name.outputs.branch == 'main' }} # 仅main分支触发部署
 | 
			
		||||
      #   run: |
 | 
			
		||||
      #     ssh -o StrictHostKeyChecking=no \
 | 
			
		||||
      #         -i "${{ secrets.SSH_PRIVATE_KEY }}" \
 | 
			
		||||
      #         ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} << 'EOF'
 | 
			
		||||
      #     # 拉取最新镜像
 | 
			
		||||
      #     docker pull ${{ env.REGISTRY }}/${{ env.GHCR_USER }}/${{ env.IMAGE_NAME }}:${{ steps.branch_name.outputs.tag }}
 | 
			
		||||
      #     # 重启服务(根据实际情况修改)
 | 
			
		||||
      #     docker-compose down || true
 | 
			
		||||
      #     docker-compose up -d
 | 
			
		||||
      #     EOF
 | 
			
		||||
     - name: SSH 部署服务器
 | 
			
		||||
        uses: appleboy/ssh-action@master
 | 
			
		||||
        with:
 | 
			
		||||
          host: '113.44.68.213'
 | 
			
		||||
          username: root
 | 
			
		||||
          password: Havocantelope420
 | 
			
		||||
          port: '22'
 | 
			
		||||
          script: |
 | 
			
		||||
            docker pull ghcr.io/catface-cn/catface_backend_go:latest
 | 
			
		||||
            docker stop catface_backend_go || true
 | 
			
		||||
            docker rm catface_backend_go || true
 | 
			
		||||
            docker run -d --name catface_backend_go -p 20201:20201 ghcr.io/catface-cn/catface_backend_go:latest
 | 
			
		||||
@ -18,5 +18,5 @@ jobs:
 | 
			
		||||
          password: Havocantelope420
 | 
			
		||||
          port: '22'
 | 
			
		||||
          script: |
 | 
			
		||||
            echo "Running command on remote server"
 | 
			
		||||
            ls -lha
 | 
			
		||||
            docker pull hello-world
 | 
			
		||||
            docker run hello-world
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user