ci: use docker cli for image publish
Some checks failed
Publish Docker image / publish (push) Failing after 3m26s

This commit is contained in:
thibaud-leclere 2026-05-06 12:03:28 +02:00
parent b332b26752
commit 304a6290c8

View file

@ -17,25 +17,27 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Install Docker CLI
run: |
apt-get update
apt-get install -y docker.io
- name: Log in to Forgejo registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.FORGEJO_REGISTRY_USERNAME }}
password: ${{ secrets.FORGEJO_REGISTRY_TOKEN }}
run: |
printf '%s' "${{ secrets.FORGEJO_REGISTRY_TOKEN }}" \
| docker login "${REGISTRY}" \
--username "${{ secrets.FORGEJO_REGISTRY_USERNAME }}" \
--password-stdin
- name: Build and push image
uses: docker/build-push-action@v6
with:
context: .
file: prod.Dockerfile
target: aio
push: true
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }}
labels: |
org.opencontainers.image.source=https://${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.version=${{ github.ref_name }}
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}"