From 9d9c4eea7810030dfa423711b408b41be8814769 Mon Sep 17 00:00:00 2001 From: Giacomo Licari Date: Fri, 1 Dec 2023 10:51:17 +0100 Subject: [PATCH] Improve CI --- .github/workflows/docker.yml | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 4c84a131daa..163c10becf4 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -43,6 +43,11 @@ jobs: run: | echo "VERSION=$(echo ${GITHUB_REF#refs/tags/})" >> $GITHUB_ENV echo "VERSION_SUFFIX=" >> $GITHUB_ENV + - name: Extract version (if hopr) + if: github.event.ref == 'refs/heads/hopr' + run: | + echo "VERSION=latest" >> $GITHUB_ENV + echo "VERSION_SUFFIX=-hopr" >> $GITHUB_ENV outputs: VERSION: ${{ env.VERSION }} VERSION_SUFFIX: ${{ env.VERSION_SUFFIX }} @@ -80,12 +85,6 @@ jobs: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - # This step uses [docker/metadata-action](https://github.com/docker/metadata-action#about) to extract tags and labels that will be applied to the specified image. The `id` "meta" allows the output of this step to be referenced in a subsequent step. The `images` value provides the base name for the tags and labels. - - name: Extract metadata (tags, labels) for Docker - id: meta - uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 - with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - name: Cross build Lighthouse binary run: | cargo install cross @@ -111,6 +110,15 @@ jobs: - name: Install QEMU run: sudo apt-get update && sudo apt-get install -y qemu-user-static + # This step uses [docker/metadata-action](https://github.com/docker/metadata-action#about) to extract tags and labels that will be applied to the specified image. The `id` "meta" allows the output of this step to be referenced in a subsequent step. The `images` value provides the base name for the tags and labels. + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + type=raw,value=${{ env.VERSION }}-${{ env.SHORT_ARCH }}${{ env.VERSION_SUFFIX }} + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2