Skip to content

Commit

Permalink
[FIX] Separate base and onbuild image steps and tags
Browse files Browse the repository at this point in the history
  • Loading branch information
PCatinean committed Mar 27, 2024
1 parent 62bd75c commit 61fa5d5
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ jobs:
registry: ghcr.io
username: ${{ secrets.BOT_LOGIN }}
password: ${{ secrets.BOT_TOKEN }}
- name: Build and push
- name: Build base image
uses: docker/build-push-action@v5
with:
context: .
Expand All @@ -134,13 +134,29 @@ jobs:
'refs/heads/master' }}
tags: |
${{ env.DOCKER_REPO }}:${{ matrix.odoo_version }}
${{ env.DOCKER_REPO }}:${{ matrix.odoo_version }}-onbuild
${{ env.GHCR_HOST }}/${{ env.DOCKER_REPO }}${{ env.DOCKER_REPO_SUFFIX }}:${{ matrix.odoo_version }}
${{ env.GHCR_HOST }}/${{ env.DOCKER_REPO }}${{ env.DOCKER_REPO_SUFFIX }}:${{ matrix.odoo_version }}-onbuild
${{ matrix.odoo_version == env.LATEST_RELEASE && format('{0}:latest', env.DOCKER_REPO) || '' }}
${{ matrix.odoo_version == env.LATEST_RELEASE && format('{0}:latest-onbuild', env.DOCKER_REPO) || '' }}
${{ matrix.odoo_version == env.LATEST_RELEASE && format('{0}/{1}{2}:latest', env.GHCR_HOST, env.DOCKER_REPO, env.DOCKER_REPO_SUFFIX) || '' }}
target: base
build-args: |
VCS_REF=${{ github.sha }}
BUILD_DATE=${{ env.BUILD_DATE }}
ODOO_VERSION=${{ matrix.odoo_version }}
- name: Build onbuild image
uses: docker/build-push-action@v5
with:
context: .
file: ./${{ matrix.odoo_version }}.Dockerfile
platforms: ${{ matrix.platforms }}
push:
${{ github.repository == 'tecnativa/doodba' && github.ref ==
'refs/heads/master' }}
tags: |
${{ env.DOCKER_REPO }}:${{ matrix.odoo_version }}-onbuild
${{ env.GHCR_HOST }}/${{ env.DOCKER_REPO }}${{ env.DOCKER_REPO_SUFFIX }}:${{ matrix.odoo_version }}-onbuild
${{ matrix.odoo_version == env.LATEST_RELEASE && format('{0}:latest-onbuild', env.DOCKER_REPO) || '' }}
${{ matrix.odoo_version == env.LATEST_RELEASE && format('{0}/{1}{2}:latest-onbuild', env.GHCR_HOST, env.DOCKER_REPO, env.DOCKER_REPO_SUFFIX) || '' }}
target: onbuild
build-args: |
VCS_REF=${{ github.sha }}
BUILD_DATE=${{ env.BUILD_DATE }}
Expand Down

0 comments on commit 61fa5d5

Please sign in to comment.