Files
pipeline-actions/.gitea/workflows/test-build.yaml
Jose Henrique dec613eb63
All checks were successful
Test build-and-push (self-test) / Build tiny multi-arch image (push) Successful in 8s
fix(build-and-push): hard-timeout the SSH probe so it can't hang
ConnectTimeout only bounds the TCP handshake; wrap ssh in a 25s timeout
plus keepalives so a firewall that accepts SYN then drops packets fails
fast with a clear diagnostic instead of hanging the runner.
2026-07-12 13:38:33 -03:00

54 lines
1.7 KiB
YAML

name: Test build-and-push (self-test)
on:
workflow_dispatch: {}
push:
branches:
- main
paths:
- build-and-push/**
- .gitea/workflows/test-build.yaml
env:
IMAGE: git.ivanch.me/ivanch/pipeline-actions-selftest
jobs:
test-build:
name: Build tiny multi-arch image
runs-on: ubuntu-amd64
steps:
- uses: actions/checkout@v4
- name: Generate a minimal Dockerfile
shell: bash
run: |
mkdir -p _selftest
cat > _selftest/Dockerfile <<'EOF'
FROM alpine:3.20
RUN echo "pipeline-actions self-test build OK"
CMD ["true"]
EOF
- name: Build and push via composite action
uses: https://git.ivanch.me/ivanch/pipeline-actions/build-and-push@main
with:
image: ${{ env.IMAGE }}
image_tag: citest
build_context: _selftest
build_dockerfile: Dockerfile
registry_password: ${{ secrets.REGISTRY_PASSWORD }}
ssh_key: ${{ secrets.SSH_KEY_DOCKERBUILD }}
- name: Verify pushed image is pullable and multi-arch
shell: bash
env:
IMAGE: ${{ env.IMAGE }}
run: |
echo "== inspecting ${IMAGE}:citest manifest =="
docker buildx imagetools inspect "${IMAGE}:citest"
# Assert both target arches are present in the manifest list.
MANIFEST="$(docker buildx imagetools inspect "${IMAGE}:citest")"
echo "${MANIFEST}" | grep -q "linux/amd64" || { echo "missing linux/amd64"; exit 1; }
echo "${MANIFEST}" | grep -q "linux/arm64" || { echo "missing linux/arm64"; exit 1; }
echo "self-test PASSED: multi-arch image built and pushed"