|
@@ -59,19 +59,32 @@ jobs:
|
|
${{ runner.os }}-buildx-
|
|
${{ runner.os }}-buildx-
|
|
- name: Login to DockerHub
|
|
- name: Login to DockerHub
|
|
if: github.ref == 'refs/heads/master'
|
|
if: github.ref == 'refs/heads/master'
|
|
- uses: docker/login-action@v1
|
|
|
|
|
|
+ uses: docker/login-action@v1
|
|
with:
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
- - name: Build and push
|
|
|
|
|
|
+ - name: Build
|
|
|
|
+ if: github.ref != 'refs/heads/master'
|
|
id: docker_build
|
|
id: docker_build
|
|
uses: docker/build-push-action@v2
|
|
uses: docker/build-push-action@v2
|
|
with:
|
|
with:
|
|
builder: ${{ steps.buildx.outputs.name }}
|
|
builder: ${{ steps.buildx.outputs.name }}
|
|
context: kafka-ui-api
|
|
context: kafka-ui-api
|
|
- push: github.ref == 'refs/heads/master'
|
|
|
|
- tags: provectuslabs/kafka-ui:${{ steps.prep.outputs.version }}
|
|
|
|
|
|
+ push: false
|
|
build-args: |
|
|
build-args: |
|
|
JAR_FILE=kafka-ui-api-${{ steps.prep.outputs.version }}.jar
|
|
JAR_FILE=kafka-ui-api-${{ steps.prep.outputs.version }}.jar
|
|
cache-from: type=local,src=/tmp/.buildx-cache
|
|
cache-from: type=local,src=/tmp/.buildx-cache
|
|
cache-to: type=local,dest=/tmp/.buildx-cache
|
|
cache-to: type=local,dest=/tmp/.buildx-cache
|
|
|
|
+ - name: Build and push
|
|
|
|
+ if: github.ref == 'refs/heads/master'
|
|
|
|
+ id: docker_build_and_push
|
|
|
|
+ uses: docker/build-push-action@v2
|
|
|
|
+ with:
|
|
|
|
+ builder: ${{ steps.buildx.outputs.name }}
|
|
|
|
+ context: kafka-ui-api
|
|
|
|
+ push: true
|
|
|
|
+ tags: provectuslabs/kafka-ui:${{ steps.prep.outputs.version }}
|
|
|
|
+ build-args: |
|
|
|
|
+ JAR_FILE=kafka-ui-api-${{ steps.prep.outputs.version }}.jar
|
|
|
|
+ cache-from: type=local,src=/tmp/.buildx-cache
|
|
|
|
+ cache-to: type=local,dest=/tmp/.buildx-cache
|