diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 73a529fa..256017e4 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -2,7 +2,7 @@ name: build on: push: - branches: master + branches: [master] release: jobs: @@ -23,7 +23,7 @@ jobs: fi TAGS="--tag ${DOCKER_IMAGE}:latest" - if [[ $VERSION =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then + if [[ -z $VERSION ]]; then TAGS="$TAGS --tag ${DOCKER_IMAGE}:${VERSION}" fi @@ -34,6 +34,9 @@ jobs: --build-arg GIT_COMMIT=${GITHUB_SHA::8} \ ${TAGS} . + - name: Set up Docker Buildx + uses: crazy-max/ghaction-docker-buildx@v3.1.0 + - name: Login env: DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} @@ -44,6 +47,7 @@ jobs: run: docker buildx build --output "type=image,push=true" ${{ steps.prepare.outputs.buildx_args }} - name: Clear + if: always() run: rm -f ${HOME}/.docker/config.json