From 306ab192167fa0e25814163a75248972103843b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Quentin=20G=C3=A9r=C3=B4me?= Date: Thu, 22 Feb 2024 11:41:27 +0100 Subject: [PATCH] chore(ci): build images also on pushes on main --- .github/workflows/build_image.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build_image.yml b/.github/workflows/build_image.yml index f30d54b..862c5c4 100644 --- a/.github/workflows/build_image.yml +++ b/.github/workflows/build_image.yml @@ -1,6 +1,8 @@ -name: Build environment image +name: Build images on: + push: + branches: [main] release: types: [ published ] @@ -25,6 +27,7 @@ jobs: - name: Store version number (on release) id: version + if: ${{ github.event_name == 'release' }} # GITHUB_REF looks like "refs/tags/0.3.1" - we need to extract the actual version without the v prefix run: echo "number=${GITHUB_REF##*/}" >> $GITHUB_OUTPUT @@ -32,7 +35,7 @@ jobs: - name: Build and push "base" image uses: docker/build-push-action@v4 with: - push: true + push: ${{ github.event_name == 'release' }} context: images/base tags: | blsq/openhexa-base-environment:${{ steps.version.outputs.number }} @@ -43,7 +46,7 @@ jobs: - name: Build and push "legacy" image uses: docker/build-push-action@v4 with: - push: true + push: ${{ github.event_name == 'release' }} context: images/legacy tags: | blsq/openhexa-legacy-environment:${{ steps.version.outputs.number }} @@ -54,11 +57,10 @@ jobs: - name: Build and push "blsq" image uses: docker/build-push-action@v4 with: - push: true + push: ${{ github.event_name == 'release' }} context: images/blsq tags: | blsq/openhexa-blsq-environment:${{ steps.version.outputs.number }} blsq/openhexa-blsq-environment:latest cache-from: type=gha - cache-to: type=gha,mode=max - \ No newline at end of file + cache-to: type=gha,mode=max \ No newline at end of file