great-ai/.forgejo/workflows/docker.yml
Andras Schmelczer b08bc3b8ae
All checks were successful
Publish documentation to great-ai.schmelczer.dev / publish (push) Successful in 1m3s
Check / Lint, format & type checks (push) Successful in 1m35s
Check / Test on Python 3.12 (push) Successful in 2m0s
Check / Test on Python 3.13 (push) Successful in 1m58s
Check / Notebooks on Python 3.12 (push) Successful in 6m29s
Check / Notebooks on Python 3.13 (push) Successful in 6m6s
Publish docker
2026-10-28 23:16:43 +00:00

68 lines
2.3 KiB
YAML

name: Publish container image on Forgejo
on:
push:
tags: ["*"]
workflow_dispatch:
env:
REGISTRY: git.schmelczer.dev
jobs:
publish:
runs-on: docker
steps:
- name: Checkout
uses: actions/checkout@v4
# The `docker` runner image is node-based and may not ship the docker CLI
# that the docker/* actions below drive; install it idempotently, as the
# sibling repos do for their Docker jobs.
- name: Ensure Docker CLI
run: |
set -eux
if ! command -v docker >/dev/null 2>&1; then
ARCH=$(uname -m)
curl -fsSL --retry 3 --retry-connrefused \
"https://download.docker.com/linux/static/stable/${ARCH}/docker-27.5.1.tgz" \
| tar xz --strip-components=1 -C /usr/local/bin docker/docker
fi
docker --version
# Marketplace actions must be referenced by full URL: this instance's
# DEFAULT_ACTIONS_URL points at code.forgejo.org, so only bare `actions/*`
# names resolve to GitHub automatically.
- name: Set up QEMU
uses: https://github.com/docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: https://github.com/docker/setup-buildx-action@v3
- name: Log in to the Forgejo container registry
uses: https://github.com/docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.repository_owner }}
password: ${{ secrets.DOCKER_PACKAGE_TOKEN }}
- name: Extract metadata for the Docker image
id: meta
uses: https://github.com/docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ github.repository }}
tags: |
type=ref,event=branch
type=ref,event=tag
type=semver,pattern={{version}}
type=raw,value=latest,enable={{is_default_branch}}
labels: |
org.opencontainers.image.source=https://git.schmelczer.dev/${{ github.repository }}
- name: Build and push
uses: https://github.com/docker/build-push-action@v6
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64