From 05ff57d802d07e5ff2093ccbc095fa34453a324a Mon Sep 17 00:00:00 2001 From: Stephan van Rooij Date: Sat, 30 May 2020 21:46:09 +0200 Subject: [PATCH] ci: Beta docker image from other branches --- .github/workflows/npm-test.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/npm-test.yml b/.github/workflows/npm-test.yml index 59dc939..2a92f68 100644 --- a/.github/workflows/npm-test.yml +++ b/.github/workflows/npm-test.yml @@ -43,8 +43,8 @@ jobs: if: steps.semantic.outputs.new_release_published == 'true' run: docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} - - name: Publish to docker with buildx - if: steps.semantic.outputs.new_release_published == 'true' + - name: Publish to docker with buildx as latest + if: steps.semantic.outputs.new_release_published == 'true' && github.ref == 'refs/heads/master' run: | docker buildx build \ --platform linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64 \ @@ -55,3 +55,15 @@ jobs: --build-arg BUILD_VERSION=${{ steps.semantic.outputs.new_release_version }} \ --build-arg VSC_REF=$(echo ${GITHUB_SHA} | cut -c1-8) \ . + - name: Publish to docker with buildx as latest + if: steps.semantic.outputs.new_release_published == 'true' && github.ref != 'refs/heads/master' + run: | + docker buildx build \ + --platform linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64 \ + --push \ + -t svrooij/smartmeter:beta \ + -t svrooij/smartmeter:${{ steps.semantic.outputs.new_release_version }} \ + --build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') \ + --build-arg BUILD_VERSION=${{ steps.semantic.outputs.new_release_version }} \ + --build-arg VSC_REF=$(echo ${GITHUB_SHA} | cut -c1-8) \ + .