5dad3f99dd
docker-build-push / build-push (push) Successful in 5s
Verified from the actual job container logs: act_runner bind-mounts /var/run/docker.sock into every job container unconditionally, even before privileged mode was enabled. The previous step's nested dockerd never actually got used.
32 lines
971 B
YAML
32 lines
971 B
YAML
name: docker-build-push
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build-push:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
# act_runner bind-mounts the admin host's real Docker socket into every
|
|
# job container (Docker-outside-of-Docker, not a nested daemon), so
|
|
# `docker` here talks straight to the host's daemon — no separate
|
|
# dockerd to start.
|
|
- name: Build and push image
|
|
env:
|
|
REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
|
|
run: |
|
|
SHA="${{ github.sha }}"
|
|
IMAGE="gitea.blairhaus.net/pmb/yttrx-welcomebot"
|
|
|
|
docker build -t "$IMAGE:$SHA" -t "$IMAGE:latest" .
|
|
printf '%s' "$REGISTRY_TOKEN" | docker login gitea.blairhaus.net -u pmb --password-stdin
|
|
docker push "$IMAGE:$SHA"
|
|
docker push "$IMAGE:latest"
|
|
docker logout gitea.blairhaus.net
|
|
|
|
echo "pushed $IMAGE:$SHA and $IMAGE:latest"
|