From b332b267527ae67a3c4e8449099f79d071d10d27 Mon Sep 17 00:00:00 2001 From: thibaud-leclere Date: Wed, 6 May 2026 11:51:00 +0200 Subject: [PATCH] ci: publish docker image on tags --- .forgejo/workflows/docker-image.yml | 41 +++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .forgejo/workflows/docker-image.yml diff --git a/.forgejo/workflows/docker-image.yml b/.forgejo/workflows/docker-image.yml new file mode 100644 index 00000000..c88c4bc7 --- /dev/null +++ b/.forgejo/workflows/docker-image.yml @@ -0,0 +1,41 @@ +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: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - 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 }} + + - 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 }}