From 0a82197451fc5d099f099995a0e29d5041e31ba8 Mon Sep 17 00:00:00 2001 From: Emmanuel Rodriguez Date: Mon, 29 Sep 2025 13:30:49 +0200 Subject: [PATCH 1/2] ci: docker build is now done with a shared workflow This will allow us to run the workflow in PRs. --- .github/workflows/docker-build.yaml | 31 +++++++++++++++++++++++++++++ .github/workflows/merge-main.yaml | 14 ++++--------- 2 files changed, 35 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/docker-build.yaml diff --git a/.github/workflows/docker-build.yaml b/.github/workflows/docker-build.yaml new file mode 100644 index 0000000..0f40553 --- /dev/null +++ b/.github/workflows/docker-build.yaml @@ -0,0 +1,31 @@ +name: Build docker image + +on: + workflow_call: + inputs: + push: + description: Indicates if the docker image has to be pushed + type: boolean + default: false + outputs: + image-tag: + description: Image tag used + value: ${{ github.event.pull_request.head.sha || github.sha }} + +defaults: + run: + shell: bash + +jobs: + build: + name: Docker Build 🐋 + runs-on: x1-core + permissions: + id-token: write + contents: read + packages: write + steps: + - name: Docker build + uses: cloudbeds/composite-actions/docker/build-push/remote@v2 + with: + push: ${{ inputs.push }} diff --git a/.github/workflows/merge-main.yaml b/.github/workflows/merge-main.yaml index 6307c6d..6168a4f 100644 --- a/.github/workflows/merge-main.yaml +++ b/.github/workflows/merge-main.yaml @@ -10,13 +10,7 @@ on: jobs: build-push: name: Build and push application image - runs-on: x1-core - permissions: - id-token: write - contents: read - steps: - - - name: Build and push application image - uses: cloudbeds/composite-actions/docker/build-push/remote@v2 - with: - push: true + uses: ./.github/workflows/docker-build.yaml + secrets: inherit + with: + push: true From 54e363dd9b0b9f9bf74b7decf60e259a51ecad72 Mon Sep 17 00:00:00 2001 From: Emmanuel Rodriguez Date: Mon, 29 Sep 2025 13:31:14 +0200 Subject: [PATCH 2/2] ci: run docker builds from PRs This way we can test if we break the build process from a PR. --- .github/workflows/pull-request.yaml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/pull-request.yaml diff --git a/.github/workflows/pull-request.yaml b/.github/workflows/pull-request.yaml new file mode 100644 index 0000000..b0882fe --- /dev/null +++ b/.github/workflows/pull-request.yaml @@ -0,0 +1,21 @@ +name: Pull Request + +on: + pull_request: + +# Cancel existing workflows running for this PR +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +defaults: + run: + shell: bash + +jobs: + docker-build: + name: Docker Build + uses: ./.github/workflows/docker-build.yaml + secrets: inherit + with: + push: false