chore: add CI image build workflow
Check Docker Environment / check-docker (push) Successful in 0s
Check New Server Env / check (push) Successful in 3s
Downgrade New Runners to v0.2.6 / downgrade (push) Successful in 1m8s
Build CI Docker Image / build-ci-image (push) Failing after 10m42s

This commit is contained in:
2026-07-13 21:00:58 +08:00
parent df47e818ba
commit ceed0636da
+63
View File
@@ -0,0 +1,63 @@
name: Build CI Docker Image
on:
workflow_dispatch:
push:
branches:
- ops/downgrade-runners
paths:
- 'infra/docker/ci.Dockerfile'
- 'requirements*.txt'
- '.gitea/workflows/build-ci-image.yml'
jobs:
build-ci-image:
runs-on: runtime-builder
steps:
- name: Checkout code
shell: sh
run: |
set -eu
python3 - <<'PY'
import io, os, tarfile, urllib.request
url = f"{os.environ['GITHUB_API_URL']}/repos/{os.environ['GITHUB_REPOSITORY']}/archive/{os.environ['GITHUB_SHA']}.tar.gz"
request = urllib.request.Request(url, headers={"Authorization": f"token {os.environ['GITHUB_TOKEN']}"})
with urllib.request.urlopen(request, timeout=120) as response:
archive = response.read()
with tarfile.open(fileobj=io.BytesIO(archive), mode='r:gz') as tar:
root_prefix = tar.getmembers()[0].name.split('/', 1)[0] + '/'
for member in tar.getmembers():
name = member.name
if name == root_prefix[:-1]:
continue
if name.startswith(root_prefix):
member.name = name[len(root_prefix):]
if member.name:
tar.extract(member, '.')
PY
- name: Build CI image
shell: sh
run: |
set -eu
cd infra/docker
docker build -f ci.Dockerfile -t localhost:5000/xiaoxia-ci-python:3.12 ../..
- name: Push CI image to local registry
shell: sh
run: |
set -eu
docker push localhost:5000/xiaoxia-ci-python:3.12
- name: Verify image in registry
shell: sh
run: |
set -eu
echo "=== Docker images ==="
docker images | grep xiaoxia-ci-python || echo "no local image found"
echo ""
echo "=== Registry catalog (via docker) ==="
docker search localhost:5000/xiaoxia-ci-python || echo "search failed"
echo ""
echo "=== Image tags ==="
curl -s http://localhost:5000/v2/xiaoxia-ci-python/tags/list || echo "curl failed"