forgejo-actions-probe/.forgejo/workflows/image-build.yaml
forgejo_admin b25a6f042f
Some checks failed
/ container-probe (push) Successful in 1s
Image Build Probe / image-build (push) Failing after 1s
/ probe (push) Successful in 0s
Fix image-build: single-step docker install+push
2026-07-03 22:41:51 +00:00

39 lines
1.2 KiB
YAML

name: Image Build Probe
on:
push:
paths:
- ".forgejo/workflows/image-build.yaml"
- "Dockerfile"
workflow_dispatch:
env:
REGISTRY: forgejo.coulomb.social
IMAGE_NAME: coulomb/forgejo-actions-probe
DOCKER_HOST: tcp://127.0.0.1:2375
jobs:
image-build:
runs-on: container-build
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build and push image
env:
REGISTRY_USER: ${{ secrets.REGISTRY_USER }}
REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
run: |
set -eu
mkdir -p "${HOME}/bin"
wget -qO- https://download.docker.com/linux/static/stable/x86_64/docker-27.3.1.tgz | tar xz --strip-components=1 -C "${HOME}/bin" docker/docker
export PATH="${HOME}/bin:${PATH}"
docker version
echo "${REGISTRY_TOKEN}" | docker login "${REGISTRY}" -u "${REGISTRY_USER}" --password-stdin
TAG="${GITHUB_SHA:-manual}"
SHORT="${TAG:0:7}"
IMAGE="${REGISTRY}/${IMAGE_NAME}"
docker build -t "${IMAGE}:latest" -t "${IMAGE}:${SHORT}" .
docker push "${IMAGE}:latest"
docker push "${IMAGE}:${SHORT}"
echo "pushed ${IMAGE}:latest and ${IMAGE}:${SHORT}"