diff --git a/.gitea/workflows/build-and-push.yml b/.gitea/workflows/build-and-push.yml index dc3cd17..ad33e4f 100644 --- a/.gitea/workflows/build-and-push.yml +++ b/.gitea/workflows/build-and-push.yml @@ -3,15 +3,22 @@ name: Build and Push Container on: push: branches: - - master - - main + - master tags: - - v* - workflow_dispatch: + - v* + workflow_dispatch: null + pull_request: + branches: + - master + +concurrency: + group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.number + || github.run_id }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} jobs: build-and-push: - runs-on: ubuntu-latest + runs-on: butler-ci env: REGISTRY: gitea.wayfinderak.com IMAGE_NAME: gitea.wayfinderak.com/wayfinderak/goff @@ -77,7 +84,7 @@ jobs: run: go test ./... - name: Log in to Gitea Container Registry - if: ${{ steps.delivery.outputs.run == 'true' }} + if: ${{ (steps.delivery.outputs.run == 'true') && github.event_name != 'pull_request' }} shell: bash run: | set -euo pipefail @@ -139,7 +146,7 @@ jobs: docker build "${build_args[@]}" . - name: Push image - if: ${{ steps.delivery.outputs.run == 'true' }} + if: ${{ (steps.delivery.outputs.run == 'true') && github.event_name != 'pull_request' }} shell: bash run: | set -euo pipefail