-
Notifications
You must be signed in to change notification settings - Fork 73
113 lines (100 loc) · 3.65 KB
/
docker_image_builder_devel.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
%YAML 1.1
---
# Workflow for building devel Docker images and pushing them to Docker hub.
# See docker_image_builder_rel.yml for the workflow that builds
# the release Docker images.
name: 'DockerImageBuilderDevel'
on:
# Build a devel Docker image whenever there is a push into the listed branches.
push:
branches:
- rel-10_0
- rel-10_1
- rel-11_0
- rel-11_1
jobs:
BuildDockerImage:
runs-on: 'ubuntu-latest'
strategy:
# create different images
matrix:
target: [ 'otobo-web', 'otobo-web-kerberos', 'otobo-elasticsearch', 'otobo-nginx-webproxy', 'otobo-nginx-kerberos-webproxy', 'otobo-selenium-chrome' ]
include:
-
target: 'otobo-web'
dockerfile: 'otobo.web.dockerfile'
context: '.'
tag_prefix: 'devel'
repository: 'rotheross/otobo'
-
target: 'otobo-web-kerberos'
dockerfile: 'otobo.web.dockerfile'
context: '.'
tag_prefix: 'devel-kerberos'
repository: 'rotheross/otobo'
-
target: 'otobo-elasticsearch'
dockerfile: 'otobo.elasticsearch.dockerfile'
context: 'scripts/elasticsearch'
tag_prefix: 'devel'
repository: 'rotheross/otobo-elasticsearch'
-
target: 'otobo-nginx-webproxy'
dockerfile: 'otobo.nginx.dockerfile'
context: 'scripts/nginx'
tag_prefix: 'devel'
repository: 'rotheross/otobo-nginx-webproxy'
-
target: 'otobo-nginx-kerberos-webproxy'
dockerfile: 'otobo.nginx.dockerfile'
context: 'scripts/nginx'
tag_prefix: 'devel'
repository: 'rotheross/otobo-nginx-kerberos-webproxy'
-
target: 'otobo-selenium-chrome'
dockerfile: 'otobo.selenium-chrome.dockerfile'
context: 'scripts/test/sample'
tag_prefix: 'devel'
repository: 'rotheross/otobo-selenium-chrome'
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
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: 'check out the relevant OTOBO branch'
uses: actions/checkout@v4
-
# check whether an devel image must be built
uses: dorny/paths-filter@v3
id: changes
with:
base: "${{ github.ref_name }}" # e.g rel-10_0
filters: |
context:
- '${{ matrix.context }}/**'
-
# login to Docker Hub before the composite action
# this avoids that secrets have to be passed
name: Login to Docker Hub
if: steps.changes.outputs.context == 'true'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
# 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