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