|
| 1 | +name: build-publish-docker-image |
| 2 | + |
| 3 | +on: [push, pull_request] |
| 4 | + |
| 5 | +jobs: |
| 6 | + build: |
| 7 | + runs-on: ubuntu-latest |
| 8 | + steps: |
| 9 | + - uses: actions/checkout@v2 |
| 10 | + - name: Get tag name |
| 11 | + id: vars |
| 12 | + run: | |
| 13 | + ref=${GITHUB_REF:10} |
| 14 | + ref="${ref////-}" |
| 15 | + echo $ref |
| 16 | + echo ::set-output name=tag::$ref |
| 17 | + - name: Build and push zookeeper-operator image |
| 18 | + uses: docker/build-push-action@v1 |
| 19 | + with: |
| 20 | + dockerfile: Dockerfile |
| 21 | + build_args: VERSION=${{ steps.vars.outputs.tag }},GIT_SHA=${{ github.sha }} |
| 22 | + username: ${{ secrets.DOCKER_USERNAME }} |
| 23 | + password: ${{ secrets.DOCKER_PASSWORD }} |
| 24 | + repository: adobe/zookeeper-operator |
| 25 | + tag_with_ref: true |
| 26 | + add_git_labels: true |
| 27 | + always_pull: true |
| 28 | + push: ${{ startsWith(github.ref, 'refs/tags/') }} |
| 29 | + - name: Build and push zookeeper Apache image |
| 30 | + uses: docker/build-push-action@v1 |
| 31 | + with: |
| 32 | + path: docker/zookeeper-image |
| 33 | + username: ${{ secrets.DOCKER_USERNAME }} |
| 34 | + password: ${{ secrets.DOCKER_PASSWORD }} |
| 35 | + repository: adobe/zookeeper |
| 36 | + tags: 3.6.2-apache-${{ steps.vars.outputs.tag }} |
| 37 | + add_git_labels: true |
| 38 | + always_pull: true |
| 39 | + push: ${{ startsWith(github.ref, 'refs/tags/zk') }} |
| 40 | + - name: Build and push zookeeper image |
| 41 | + uses: docker/build-push-action@v1 |
| 42 | + with: |
| 43 | + path: docker |
| 44 | + username: ${{ secrets.DOCKER_USERNAME }} |
| 45 | + password: ${{ secrets.DOCKER_PASSWORD }} |
| 46 | + repository: adobe/zookeeper |
| 47 | + tags: 3.6.2-${{ steps.vars.outputs.tag }} |
| 48 | + add_git_labels: true |
| 49 | + always_pull: true |
| 50 | + push: ${{ startsWith(github.ref, 'refs/tags/') }} |
0 commit comments