Files
image/.gitea/workflows/beszel-agent-gpu.yml
thuanle b823333d5d
gitea-mcp image / build (arm64) (push) Successful in 13s
beszel-agent-gpu image / build (amd64) (push) Successful in 31s
beszel-agent-gpu image / amend-manifest (push) Successful in 3s
gitea-mcp image / amend-manifest (push) Successful in 9s
restructure per-image dirs + onpush paths filter; add beszel-agent-gpu image
2026-09-07 15:49:50 +07:00

71 lines
2.1 KiB
YAML

name: beszel-agent-gpu image
on:
push:
paths:
- beszel-agent-gpu/**
schedule:
- cron: '30 2 * * 0' # 02:30 sáng Chủ nhật (UTC), lệch giờ với gitea-mcp
workflow_dispatch: # Cho phép chạy tay nếu cần
env:
IMAGE_REPO: git.thuanle.me/public/beszel-agent-gpu
IMAGE: beszel-agent-gpu
jobs:
build:
strategy:
matrix:
arch:
# GPU NVIDIA chỉ có trên máy amd64 (server ta)
- amd64
runs-on: ${{ matrix.arch }}
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Login to Docker Registry
uses: docker/login-action@v4
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 }}"
# --pull: luôn lấy binary / base image mới nhất, đây là cơ chế
# update hàng tuần của image này
docker build \
--pull \
-f ${{ env.IMAGE }}/Dockerfile \
-t ${{ env.IMAGE_REPO }}:${{ matrix.arch }}-latest \
--label "build_date=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \
--label "commit_sha=${{ github.sha }}" \
${{ env.IMAGE }}
docker push ${{ env.IMAGE_REPO }}:${{ matrix.arch }}-latest
amend-manifest:
runs-on: linux
needs: [build]
steps:
- name: Login to Docker Registry
uses: docker/login-action@v4
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_REPO }}:latest || true
echo "Create new manifest"
docker manifest create ${{ env.IMAGE_REPO }}:latest \
${{ env.IMAGE_REPO }}:amd64-latest
docker manifest push ${{ env.IMAGE_REPO }}:latest