diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index fdfeb05..8a02db1 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -4,6 +4,8 @@ on: push: branches: - 'master' + release: + types: [published] jobs: docker: @@ -25,9 +27,20 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - + # Push to master branch - push "latest" tag name: Build and push + if: github.event_name == 'push' uses: docker/build-push-action@v2 with: context: . push: true tags: xy2z/pinedocs:latest + - + # Push the new release + name: Build and push + if: github.event_name == 'release' + uses: docker/build-push-action@v2 + with: + context: . + push: true + tags: xy2z/pinedocs-test:${{ github.event.release.tag_name }}