Skip to content

Commit

Permalink
chore(ci): build images also on pushes on main
Browse files Browse the repository at this point in the history
  • Loading branch information
qgerome committed Feb 22, 2024
1 parent d344da5 commit 306ab19
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/build_image.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: Build environment image
name: Build images

on:
push:
branches: [main]
release:
types: [ published ]

Expand All @@ -25,14 +27,15 @@ 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

# Build all images
- 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 }}
Expand All @@ -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 }}
Expand All @@ -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

cache-to: type=gha,mode=max

0 comments on commit 306ab19

Please sign in to comment.