Skip to content

Commit

Permalink
Issue #3448: start using a matrix for the job
Browse files Browse the repository at this point in the history
  • Loading branch information
bschmalhofer committed Jul 25, 2024
1 parent 7dd8275 commit 7d6530c
Showing 1 changed file with 23 additions and 12 deletions.
35 changes: 23 additions & 12 deletions .github/workflows/docker_image_update_checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,30 @@ on:
jobs:
CheckDockerImageUpdate:
runs-on: 'ubuntu-latest'
strategy:

# set up a loop over OTOBO branches
matrix:
major_minor: [ '11_1', ]
include:
- major_minor: '11_1'
- base_image: 'perl:5.40-slim-bookworm'

steps:

- name: Setup for the branch rel-11_1
- name: Setting up the environment file
run: |
docker_tag="devel-11_1_test"
major_minor="${{ matrix.major_minor }}"
docker_tag="devel-${major_minor}_test"
mixed_case_repository="${{ github.repository }}"
lowercased_repository="${mixed_case_repository,,}"
build_date=$(date -u +'%Y-%m-%dT%H:%M:%SZ')
(
echo "otobo_branch=rel-11_1"
echo "otobo_base_image=perl:5.40-slim-bookworm"
echo "otobo_docker_tag=$docker_tag"
echo "otobo_ref=$lowercased_repository:$docker_tag"
echo "otobo_build_date=$build_date"
echo "otobo_branch=rel-${major_minor}"
echo "otobo_base_image=${{ matrix.base_image }}"
echo "otobo_docker_tag=${docker_tag}"
echo "otobo_image=${lowercased_repository}:${docker_tag}"
echo "otobo_build_date=${build_date}"
) >> $GITHUB_ENV
-
Expand All @@ -43,7 +53,7 @@ jobs:
uses: lucacome/docker-image-update-checker@v1
with:
base-image: ${{ env.otobo_base_image }}
image: ${{ env.otobo_ref }}
image: ${{ env.otobo_image }}

-
# print the result in any case
Expand All @@ -56,7 +66,8 @@ jobs:
if: steps.check.outputs.needs-updating == 'true'
uses: docker/setup-buildx-action@v3

- name: 'check out the relevant OTOBO branch'
-
name: 'check out the relevant OTOBO branch'
if: steps.check.outputs.needs-updating == 'true'
uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -88,7 +99,7 @@ jobs:
GIT_BRANCH=${{ env.otobo_branch }}
GIT_COMMIT=${{ env.otobo_commit }}
target: otobo-web
tags: ${{ env.otobo_ref }}
tags: ${{ env.otobo_image }}
cache-from: type=gha
cache-to: type=gha,mode=max`

Expand All @@ -97,7 +108,7 @@ jobs:
name: Info
if: steps.check.outputs.needs-updating == 'true'
run: |
docker run --rm -w /opt/otobo_install/otobo_next --entrypoint /bin/bash $otobo_ref -c "more git-repo.txt git-branch.txt git-commit.txt RELEASE | cat"
docker run --rm -w /opt/otobo_install/otobo_next --entrypoint /bin/bash $otobo_image -c "more git-repo.txt git-branch.txt git-commit.txt RELEASE | cat"
-
# login to Docker Hub only after the build
Expand Down Expand Up @@ -126,6 +137,6 @@ jobs:
GIT_BRANCH=${{ env.otobo_branch }}
GIT_COMMIT=${{ env.otobo_commit }}
target: otobo-web
tags: ${{ env.otobo_ref }}
tags: ${{ env.otobo_image }}
cache-from: type=gha
cache-to: type=gha,mode=max`

0 comments on commit 7d6530c

Please sign in to comment.