api-client/.forgejo/workflows/docker-image.yml
thibaud-leclere 304a6290c8
Some checks failed
Publish Docker image / publish (push) Failing after 3m26s
ci: use docker cli for image publish
2026-05-06 12:03:28 +02:00

43 lines
1.1 KiB
YAML

name: Publish Docker image
on:
push:
tags:
- "*"
env:
REGISTRY: forge.lclr.dev
IMAGE_NAME: thibaud-lclr/api-client
jobs:
publish:
runs-on: docker
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Docker CLI
run: |
apt-get update
apt-get install -y docker.io
- name: Log in to Forgejo registry
run: |
printf '%s' "${{ secrets.FORGEJO_REGISTRY_TOKEN }}" \
| docker login "${REGISTRY}" \
--username "${{ secrets.FORGEJO_REGISTRY_USERNAME }}" \
--password-stdin
- name: Build and push image
run: |
IMAGE_TAG="${REGISTRY}/${IMAGE_NAME}:${{ github.ref_name }}"
docker build \
--file prod.Dockerfile \
--target aio \
--label "org.opencontainers.image.source=https://${REGISTRY}/${IMAGE_NAME}" \
--label "org.opencontainers.image.revision=${{ github.sha }}" \
--label "org.opencontainers.image.version=${{ github.ref_name }}" \
--tag "${IMAGE_TAG}" \
.
docker push "${IMAGE_TAG}"