diff --git a/.gitea/workflows/docker-push.yml b/.gitea/workflows/docker-push.yml new file mode 100644 index 0000000..8334410 --- /dev/null +++ b/.gitea/workflows/docker-push.yml @@ -0,0 +1,35 @@ +name: Docker Push Validation + +# Phase 3 validation: docker/login-action + docker build + docker push. +# Runs on the `host` label so it uses the runner's bundled Docker CLI and the +# mounted /var/run/docker.sock. Pushes a small throwaway image to a -citest path. +# +# Requires repo Action secrets REGISTRY_USER / REGISTRY_TOKEN. + +on: + workflow_dispatch: + +jobs: + build-push: + runs-on: host + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Log in to Gitea Container Registry + uses: docker/login-action@v3 + with: + registry: registry.alwisp.com + username: ${{ secrets.REGISTRY_USER }} + password: ${{ secrets.REGISTRY_TOKEN }} + + - name: Build and push a test image + run: | + IMAGE="registry.alwisp.com/jason/forgerunner-citest" + TAG="${{ gitea.sha }}" + # Minimal image built from a cached base — validates build + push only. + printf 'FROM ubuntu:22.04\nRUN echo "forgerunner CI push OK at build time"\n' > Dockerfile.citest + docker build -t "${IMAGE}:${TAG}" -t "${IMAGE}:latest" -f Dockerfile.citest . + docker push "${IMAGE}:${TAG}" + docker push "${IMAGE}:latest" + echo "Pushed ${IMAGE}:${TAG}"