diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 1bc1c6c..f35c5d3 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -23,12 +23,28 @@ jobs: name: Push Docker image to Docker Hub runs-on: ubuntu-latest steps: - - name: Check out the repo + - + name: Check out the repo uses: actions/checkout@v2 - - name: Push to Docker Hub - uses: docker/build-push-action@v1 + - + name: Docker meta + id: meta + uses: docker/metadata-action@v3 with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - repository: simojenki/bonob - tag_with_ref: true + images: simojenki/bonob + - + name: Login to DockerHub + if: github.event_name != 'pull_request' + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - + name: Push to Docker Hub + uses: docker/build-push-action@v2 + with: + context: . + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: latest +