Mover workflow MCP Docker a .gitea/workflows
This commit is contained in:
50
.gitea/workflows/deploy-mcp-docker.yml
Normal file
50
.gitea/workflows/deploy-mcp-docker.yml
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
name: Deploy MCP Docker Server
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
paths:
|
||||||
|
- 'mcp-docker-server/**'
|
||||||
|
- '.github/workflows/deploy-mcp-docker.yml'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-deploy:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- name: Log in to Gitea Container Registry
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: ${{ secrets.REGISTRY_URL }}
|
||||||
|
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||||
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||||
|
|
||||||
|
- name: Build and push Docker image
|
||||||
|
uses: docker/build-push-action@v5
|
||||||
|
with:
|
||||||
|
context: ./mcp-docker-server
|
||||||
|
push: true
|
||||||
|
tags: |
|
||||||
|
${{ secrets.REGISTRY_URL }}/${{ secrets.REPO_OWNER }}/mcp-docker-server:latest
|
||||||
|
${{ secrets.REGISTRY_URL }}/${{ secrets.REPO_OWNER }}/mcp-docker-server:${{ github.sha }}
|
||||||
|
cache-from: type=registry,ref=${{ secrets.REGISTRY_URL }}/${{ secrets.REPO_OWNER }}/mcp-docker-server:buildcache
|
||||||
|
cache-to: type=registry,ref=${{ secrets.REGISTRY_URL }}/${{ secrets.REPO_OWNER }}/mcp-docker-server:buildcache,mode=max
|
||||||
|
|
||||||
|
- name: Deploy to server
|
||||||
|
uses: appleboy/ssh-action@v1.0.3
|
||||||
|
with:
|
||||||
|
host: ${{ secrets.SERVER_HOST }}
|
||||||
|
username: ${{ secrets.SERVER_USER }}
|
||||||
|
key: ${{ secrets.SERVER_SSH_KEY }}
|
||||||
|
script: |
|
||||||
|
cd ${{ secrets.DEPLOY_PATH }}
|
||||||
|
docker compose pull mcp-docker
|
||||||
|
docker compose up -d mcp-docker
|
||||||
|
docker image prune -f
|
||||||
Reference in New Issue
Block a user