diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0bc9263..94df446 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -41,3 +41,19 @@ jobs: - name: Run Code Coverage run: | make coverage + + publish: + needs: [build] + name: Publish docker image + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Push to Docker Hub + uses: docker/build-push-action@v1 + if: startsWith(github.ref, 'refs/tags/v') || startsWith(github.ref, 'refs/heads/master') + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + repository: containersol/prom-metrics-check + tag_with_ref: true + tag_with_sha: true