From 52edc14970a1493201f7cf918f2e6d51489e8e23 Mon Sep 17 00:00:00 2001 From: Tobias Lindberg Date: Sun, 2 Jan 2022 13:50:09 +0100 Subject: [PATCH] removing build_info step and adding if main ignore --- .github/workflows/build.yml | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4383bc5..21acd72 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,7 +30,7 @@ jobs: ghcr.io/tobiasehlert/teslamateapi tags: | type=edge - type=ref,event=branch + type=ref,event=branch,enable=${{ (github.ref != 'refs/heads/main') }} type=semver,pattern=v{{version}} type=semver,pattern=v{{major}}.{{minor}} @@ -63,15 +63,6 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Configure build information - id: build_information - run: | - if [[ ${{ github.ref_type }} == "tag" ]]; then - echo "::set-output name=release_name::$( echo ${{ github.ref_name }} )" - else - echo "::set-output name=release_name::$( echo unknown )" - fi - - name: Build and push uses: docker/build-push-action@v2.7.0 with: @@ -84,4 +75,4 @@ jobs: cache-from: type=local,src=/tmp/.buildx-cache cache-to: type=local,dest=/tmp/.buildx-cache build-args: | - apiVersion=${{ steps.build_information.outputs.release_name }} + apiVersion=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}