Skip to content

DockerImageBuilderRel #4

DockerImageBuilderRel

DockerImageBuilderRel #4

%YAML 1.1
---
# Workflow for building release Docker images and pushing them to Docker hub.
# See docker_image_builder_devel.yml for the workflow that builds
# the devel Docker images.
name: 'DockerImageBuilderRel'
on:
# Build a devel Docker image whenever there is a push into the listed branches.
push:
tags:
- test-[0-9]+_[0-9]+_[0-9]+_*
jobs:
BuildDockerImage:
runs-on: 'ubuntu-latest'
strategy:
# create different images
# note that there is no otobo-web-kerberos target
matrix:
target: [ 'otobo-web', 'otobo-elasticsearch', 'otobo-nginx-webproxy', 'otobo-nginx-kerberos-webproxy', 'otobo-selenium-chrome' ]
tag_prefix: [ 'test' ]
include:
-
target: 'otobo-web'
dockerfile: 'otobo.web.dockerfile'
context: '.'
repository: 'rotheross/otobo'
-
target: 'otobo-elasticsearch'
dockerfile: 'otobo.elasticsearch.dockerfile'
context: 'scripts/elasticsearch'
repository: 'rotheross/otobo-elasticsearch'
-
target: 'otobo-nginx-webproxy'
dockerfile: 'otobo.nginx.dockerfile'
context: 'scripts/nginx'
repository: 'rotheross/otobo-nginx-webproxy'
-
target: 'otobo-nginx-kerberos-webproxy'
dockerfile: 'otobo.nginx.dockerfile'
context: 'scripts/nginx'
repository: 'rotheross/otobo-nginx-kerberos-webproxy'
-
target: 'otobo-selenium-chrome'
dockerfile: 'otobo.selenium-chrome.dockerfile'
context: 'scripts/test/sample'
repository: 'rotheross/otobo-nginx-kerberos-webproxy'
steps:
-
# Store some variables in an environment file so that
# they can be used in the later steps.
name: Setup
run: |
branch="${{ github.ref_name }}" # e.g rel-10_0_22
docker_tag="${{ matrix.tag_prefix }}-$branch"
build_date=$(date -u +'%Y-%m-%dT%H:%M:%SZ')
(
echo "otobo_branch=$branch"
echo "otobo_docker_tag=$docker_tag"
echo "otobo_ref=${{ matrix.repository }}:$docker_tag"
echo "otobo_build_date=$build_date"
echo "otobo_commit=${{ github.sha }}"
) >> $GITHUB_ENV
- name: 'devel output'
run: |
echo 'matrix.target: ${{ matrix.target }}'
echo 'matrix.tag_prefix: ${{ matrix.tag_prefix }}'
echo 'env.otobo_branch: ${{ env.otobo_branch }}'
echo 'env.otobo_build_date: ${{ env.otobo_build_date }}'
echo 'env.otobo_commit: ${{ env.otobo_commit }}'
echo 'github.ref: ${{ github.ref }}'
echo 'github.ref_name: ${{ github.ref_name }}'
echo 'github.ref_type: ${{ github.ref_type }}'
echo 'github.event_name: ${{ github.event_name }}'
- name: 'check out the relevant OTOBO branch'
uses: actions/checkout@v4
-
# Uses a local composite action.
# The repository must already be checked out.
name: 'Run local composite action'
#if: steps.changes.outputs.context == 'true'
uses: ./.github/actions/docker_image_builder
with:
context: ${{ matrix.context }}
dockerfile: ${{ matrix.dockerfile }}