From 6de396fda323b357c511b037f1aeb997f85ef58e Mon Sep 17 00:00:00 2001 From: matteo-cristino Date: Mon, 23 Sep 2024 10:05:22 +0200 Subject: [PATCH] ci: update docker release CI runs only on tags push --- .github/workflows/publish-docker.yml | 61 +++------------------------- 1 file changed, 5 insertions(+), 56 deletions(-) diff --git a/.github/workflows/publish-docker.yml b/.github/workflows/publish-docker.yml index 036390e27..372fb8f74 100644 --- a/.github/workflows/publish-docker.yml +++ b/.github/workflows/publish-docker.yml @@ -2,63 +2,12 @@ name: Create and publish a Docker image on: push: - branches: - - 'master' tags: - 'v*' - pull_request: - branches: - - 'master' - -env: - REGISTRY: ghcr.io - IMAGE_NAME: dyne/zenroom jobs: - build-and-push-image: - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Extract metadata (tags, labels) for Docker - id: meta - uses: docker/metadata-action@v3 - with: - images: | - ${{ env.IMAGE_NAME }} - ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - tags: | - type=edge - type=sha - type=semver,pattern={{version}} - type=semver,pattern={{major}}.{{minor}} - labels: | - org.opencontainers.image.vendor=Dyne.org - - - name: Log in Docker Hub - uses: docker/login-action@v1 - if: github.event_name != 'pull_request' - with: - username: dyne - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Log in to the Container registry - uses: docker/login-action@v1 - if: github.event_name != 'pull_request' - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build and push Docker image - uses: docker/build-push-action@v2 - if: github.event_name != 'pull_request' - with: - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} + publish_docker_image: + name: 🐳 Publish Docker image + needs: semantic-release + uses: ForkbombEu/workflows/.github/workflows/publish-ghcr.yml@main + secrets: inherit