Compare commits

7 Commits
5 changed files with 80 additions and 23 deletions
+3
View File
@@ -0,0 +1,3 @@
.git
.gitea
codex-ssh-test.md
+44 -22
View File
@@ -1,34 +1,56 @@
name: Test Runner name: Build and Push Image
on: [push]
on:
push:
branches:
- main
workflow_dispatch:
jobs: jobs:
test-check: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: container:
image: ubuntu:latest image: docker:27-cli
steps: steps:
- name: Say Hello - name: Install Actions dependencies
run: echo "Testing connection..." run: apk add --no-cache git nodejs
- name: Install Net Tools - name: Checkout repository
run: | uses: actions/checkout@v4
apt-get update
apt-get install -y iputils-ping
- name: Install Docker CLI - name: Verify Docker-in-Docker
run: | run: docker info
apt-get update && apt-get install -y docker.io
- name: Debug Network (Ping Test) - name: Log in to Gitea Registry
run: | run: |
echo "正在嘗試 Ping docker (DinD service)..." echo "${{ secrets.REGISTRY_TOKEN }}" |
# 使用 service name "docker" 而不是 container_name "gitea_dind" docker login git.karylab.com \
ping -c 3 docker --username "karylab_agents" \
--password-stdin
- name: Test Docker Connection - name: Build and test image
run: | run: |
echo "正在嘗試連線 Docker API..." IMAGE="git.karylab.com/karylab_agents/test-runner"
echo "DOCKER_HOST = $DOCKER_HOST" docker build --progress=plain \
docker ps --tag "${IMAGE}:${{ gitea.sha }}" \
echo "成功!可以看到上面的容器列表了!" --tag "${IMAGE}:latest" \
.
output="$(docker run --rm "${IMAGE}:${{ gitea.sha }}")"
echo "$output"
test "$output" = "Gitea Runner Docker build succeeded."
- name: Push image
run: |
IMAGE="git.karylab.com/karylab_agents/test-runner"
docker push "${IMAGE}:${{ gitea.sha }}"
docker push "${IMAGE}:latest"
- name: Pull and verify published image
run: |
IMAGE="git.karylab.com/karylab_agents/test-runner"
docker image rm "${IMAGE}:${{ gitea.sha }}" "${IMAGE}:latest"
docker pull "${IMAGE}:latest"
output="$(docker run --rm "${IMAGE}:latest")"
echo "$output"
test "$output" = "Gitea Runner Docker build succeeded."
+15
View File
@@ -0,0 +1,15 @@
FROM alpine:3.22.5 AS builder
RUN apk add --no-cache build-base
WORKDIR /src
COPY hello.c .
RUN mkdir -p /out \
&& cc -O2 -Wall -Wextra -Werror -static hello.c -o /out/hello
FROM scratch
COPY --from=builder /out/hello /hello
ENTRYPOINT ["/hello"]
+10
View File
@@ -0,0 +1,10 @@
# Codex SSH write test
This file verifies that the Codex shell can:
1. authenticate with the dedicated SSH key;
2. clone this repository;
3. create a commit; and
4. push the commit to Gitea.
Test date: 2026-07-29
+7
View File
@@ -0,0 +1,7 @@
#include <stdio.h>
int main(void)
{
puts("Gitea Runner Docker build succeeded.");
return 0;
}