rosenvold-core/.forgejo/workflows/build.yml
Lucas Seidelin Rosenvold Christensen 73144b91aa
Some checks failed
Build and push image / build-and-push (push) Failing after 15s
Drop buildx, use plain docker build/push
docker/setup-buildx-action resolves its builder endpoint from the
docker context file rather than the live DOCKER_HOST env var, so it
still tried the (absent) unix socket. Plain docker CLI commands
honor DOCKER_HOST directly, matching what the runner now provides.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-18 15:36:20 +02:00

44 lines
1.7 KiB
YAML

name: Build and push image
on:
push:
branches:
- master
jobs:
build-and-push:
runs-on: docker
# actions/checkout is a JS action and needs Node, so the job container
# has to be a Node image. The runner already provides a privileged
# container wired up to its own dind sidecar via DOCKER_HOST, so we
# just need the docker CLI itself. Plain `docker` commands (rather
# than buildx-based actions) pick up DOCKER_HOST directly.
container: node:20-bookworm
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Docker CLI
run: |
apt-get update
apt-get install -y --no-install-recommends ca-certificates curl
install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
chmod a+r /etc/apt/keyrings/docker.asc
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian $(. /etc/os-release && echo $VERSION_CODENAME) stable" \
> /etc/apt/sources.list.d/docker.list
apt-get update
apt-get install -y --no-install-recommends docker-ce-cli
- name: Log in to Forgejo registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login git.rosenvold.tech -u "${{ github.actor }}" --password-stdin
- name: Build image
run: |
docker build \
-t git.rosenvold.tech/lucas/rosenvold-core:latest \
-t git.rosenvold.tech/lucas/rosenvold-core:${{ github.sha }} \
-f Containerfile .
- name: Push image
run: docker push git.rosenvold.tech/lucas/rosenvold-core --all-tags