diff --git a/.github/workflows/docker-release.yml b/.github/workflows/docker-release.yml index 55c6454..2478b1b 100644 --- a/.github/workflows/docker-release.yml +++ b/.github/workflows/docker-release.yml @@ -1,12 +1,12 @@ -name: Build and Publish +name: Build and Push [DockerHub] on: push: tags: - - '*' + - '*.*.*' env: - IMAGE: flow-pubsub + GITHUB_SHA: ${{ github.sha }} jobs: setup-build-publish: @@ -15,23 +15,12 @@ jobs: steps: - name: Checkout - uses: actions/checkout@master - - # Setup project version - - name: Get version - id: version - run: | - VERSION="dev" - if [[ "${GITHUB_REF/refs\/tags\//}" != "refs/heads/"* ]] ; then - VERSION="${GITHUB_REF/refs\/tags\//}" - fi - echo ::set-output name=VERSION::${VERSION} + uses: actions/checkout@v3 # Build the Docker image - name: Build run: | - VERSION=${{ steps.version.outputs.VERSION }} - DOCKER_VER=${VERSION#"v"} + VERSION=${{github.ref_name}} docker build \ -t flowlab/"$IMAGE":latest \ -t flowlab/"$IMAGE":"$DOCKER_VER" . @@ -40,6 +29,6 @@ jobs: run: | docker login --username flowlab --password ${{ secrets.DOCKERHUB_TOKEN }} - - name: Publish DockerHub + - name: Publish all tags to DockerHub run: | - docker push flowlab/$IMAGE \ No newline at end of file + docker push -a flowlab/"$IMAGE" \ No newline at end of file