diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 560da788..89a3ebb3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,9 +1,13 @@ name: docker-buildx on: pull_request: - branches: master + branches: + - master + - experimental push: - branches: master + branches: + - master + - experimental tags: - '*.*' @@ -84,7 +88,7 @@ jobs: strategy: matrix: container: [alpine, debian-stretch, debian-buster] - + steps: - name: Set tag @@ -112,15 +116,25 @@ jobs: password: ${{ secrets.REGISTRY_PASSWORD }} - name: Test build on Pull request - if: ${{ startsWith(steps.vars.outputs.type , 'head') && github.event.issue.pull_request }} + if: ${{ startsWith(steps.vars.outputs.type , 'head') && github.event.issue.pull_request && github.ref == 'refs/heads/master' }} uses: docker/build-push-action@v2 with: context: . file: docker/${{ matrix.container }}/Dockerfile.build platforms: linux/amd64,linux/arm64,linux/arm/v7 + - + name: Build experimental + if: ${{ github.ref == 'refs/heads/experimental' }} + uses: docker/build-push-action@v2 + with: + context: . + file: docker/${{ matrix.container }}/Dockerfile.build + platforms: linux/amd64,linux/arm64,linux/arm/v7 + push: true + tags: bpatrik/pigallery2:experimental-${{ matrix.container }} - name: Build and push nightly on new master commit - if: ${{ startsWith(steps.vars.outputs.type , 'head') && !github.event.issue.pull_request }} + if: ${{ startsWith(steps.vars.outputs.type , 'head') && !github.event.issue.pull_request && github.ref == 'refs/heads/master' }} uses: docker/build-push-action@v2 with: context: . @@ -130,7 +144,7 @@ jobs: tags: bpatrik/pigallery2:nightly-${{ matrix.container }} - name: Build and push release on new Tag - if: ${{ startsWith(steps.vars.outputs.type , 'tag') && !github.event.issue.pull_request }} + if: ${{ startsWith(steps.vars.outputs.type , 'tag') && !github.event.issue.pull_request && github.ref == 'refs/heads/master' }} uses: docker/build-push-action@v2 with: context: .