gitea-mcp
This commit is contained in:
@@ -0,0 +1,66 @@
|
|||||||
|
name: docker-node image
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
schedule:
|
||||||
|
- cron: '0 2 * * 0' # 00:00 sáng Chủ nhật (UTC)
|
||||||
|
workflow_dispatch: # Cho phép chạy tay nếu cần
|
||||||
|
|
||||||
|
env:
|
||||||
|
IMAGE_BASE: git.thuanle.me/public/image
|
||||||
|
IMAGE: gitea-mcp
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
arch:
|
||||||
|
- arm64
|
||||||
|
# - amd64
|
||||||
|
runs-on: ${{ matrix.arch }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Login to Docker Registry
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: git.thuanle.me
|
||||||
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
|
||||||
|
- name: Build Docker images
|
||||||
|
run: |
|
||||||
|
echo "Building image ${{ env.IMAGE }} for architecture: ${{ matrix.arch }}"
|
||||||
|
|
||||||
|
docker build \
|
||||||
|
-f ${{ env.IMAGE }}.Dockerfile \
|
||||||
|
-t ${{ env.IMAGE_BASE }}:${{ env.IMAGE }}-${{ matrix.arch }}-latest \
|
||||||
|
--label "build_date=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \
|
||||||
|
--label "commit_sha=${{ github.sha }}" \
|
||||||
|
.
|
||||||
|
|
||||||
|
docker push ${{ env.IMAGE_BASE }}:${{ env.IMAGE }}-${{ matrix.arch }}-latest
|
||||||
|
|
||||||
|
amend-manifest:
|
||||||
|
runs-on: linux
|
||||||
|
needs: [build]
|
||||||
|
steps:
|
||||||
|
- name: Login to Docker Registry
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: git.thuanle.me
|
||||||
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
|
||||||
|
- name: Push Docker manifest
|
||||||
|
run: |
|
||||||
|
echo "Delete existing manifest"
|
||||||
|
docker manifest rm ${{ env.IMAGE_BASE }}:${{ env.IMAGE }}-latest || true
|
||||||
|
|
||||||
|
echo "Create new manifest"
|
||||||
|
docker manifest create ${{ env.IMAGE_BASE }}:${{ env.IMAGE }}-latest \
|
||||||
|
${{ env.IMAGE_BASE }}:${{ env.IMAGE }}-amd64-latest \
|
||||||
|
${{ env.IMAGE_BASE }}:${{ env.IMAGE }}-arm64-latest
|
||||||
|
|
||||||
|
docker manifest push ${{ env.IMAGE_BASE }}:${{ env.IMAGE }}-latest
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
# image
|
||||||
|
|
||||||
|
Repo này nhằm để build lại các Docker image hay dùng, đồng thời tự động cập nhật theo lịch hàng tuần.
|
||||||
|
|
||||||
|
## Images
|
||||||
|
|
||||||
|
### gitea-mcp
|
||||||
|
|
||||||
|
Registry: `git.thuanle.me/public/image:gitea-mcp-latest`
|
||||||
|
|
||||||
|
Image chạy [gitea-mcp](https://gitea.com/gitea/gitea-mcp) — MCP server cho Gitea.
|
||||||
|
|
||||||
|
- Base: `alpine:latest`
|
||||||
|
- Tự động lấy phiên bản mới nhất từ Gitea releases khi build
|
||||||
|
- Hỗ trợ kiến trúc: `amd64`, `arm64`, `i386`
|
||||||
|
- Build tự động mỗi Chủ nhật lúc 02:00 UTC
|
||||||
|
|
||||||
|
**Chạy:**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker run --rm git.thuanle.me/public/image:gitea-mcp-latest --help
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
FROM alpine:latest
|
||||||
|
|
||||||
|
# Cài đặt curl, tar, ca-certificates và thêm jq (để parse JSON)
|
||||||
|
RUN apk add --no-cache curl tar ca-certificates jq
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
ARG TARGETARCH
|
||||||
|
|
||||||
|
# Gộp việc lấy version, tải file và giải nén vào 1 layer duy nhất để tối ưu
|
||||||
|
RUN echo "Đang tìm phiên bản mới nhất..." && \
|
||||||
|
# Chuyển đổi TARGETARCH sang tên file release
|
||||||
|
case "${TARGETARCH}" in \
|
||||||
|
amd64) ARCH="x86_64" ;; \
|
||||||
|
arm64) ARCH="arm64" ;; \
|
||||||
|
386) ARCH="i386" ;; \
|
||||||
|
*) echo "Kiến trúc không được hỗ trợ: ${TARGETARCH}" && exit 1 ;; \
|
||||||
|
esac && \
|
||||||
|
# 1. Gọi API Gitea và dùng jq để lấy giá trị tag_name
|
||||||
|
LATEST_VERSION=$(curl -s https://gitea.com/api/v1/repos/gitea/gitea-mcp/releases/latest | jq -r .tag_name) && \
|
||||||
|
echo "Phát hiện phiên bản mới nhất: ${LATEST_VERSION} cho kiến trúc: ${ARCH}" && \
|
||||||
|
# 2. Tải binary tương ứng với version và kiến trúc
|
||||||
|
curl -L -o gitea-mcp.tar.gz "https://gitea.com/gitea/gitea-mcp/releases/download/${LATEST_VERSION}/gitea-mcp_Linux_${ARCH}.tar.gz" && \
|
||||||
|
# 3. Giải nén và đưa vào thư mục thực thi
|
||||||
|
tar -xzf gitea-mcp.tar.gz && \
|
||||||
|
mv gitea-mcp /usr/local/bin/gitea-mcp && \
|
||||||
|
# 4. Dọn dẹp rác
|
||||||
|
rm -f gitea-mcp.tar.gz README.md LICENSE
|
||||||
|
|
||||||
|
# Cấp quyền thực thi
|
||||||
|
RUN chmod +x /usr/local/bin/gitea-mcp
|
||||||
|
|
||||||
|
# Cấu hình thư mục log
|
||||||
|
ENV HOME=/app
|
||||||
|
|
||||||
|
# Chạy binary
|
||||||
|
ENTRYPOINT ["gitea-mcp"]
|
||||||
Reference in New Issue
Block a user