1
- name : Build UBI ppc64le Dependency
1
+ name : Build UBI c-ares Dependency
2
2
3
3
on :
4
4
push :
5
5
branches :
6
6
- main
7
+ - feat/add-otel-support
7
8
paths :
8
- - build/dependencies/Dockerfile.ubi
9
+ - build/dependencies/Dockerfile.ubi8
10
+ - build/dependencies/Dockerfile.ubi9
9
11
workflow_dispatch :
10
- inputs :
11
- nginx_version :
12
- type : string
13
- description : " NGINX Version to build for"
14
- required : false
15
- force :
16
- type : boolean
17
- description : " Force rebuild"
18
- required : false
19
- default : false
20
12
21
13
env :
22
- IMAGE_NAME : ghcr.io/nginx/dependencies/nginx-ubi-ppc64le
14
+ IMAGE_NAME : ghcr.io/nginx/dependencies/nginx-ubi
23
15
24
16
concurrency :
25
- group : ${{ github.ref_name }}-ubi-ppc64le- build
17
+ group : ${{ github.ref_name }}-ubi-build
26
18
cancel-in-progress : true
27
19
28
20
permissions :
29
21
contents : read
30
22
31
23
jobs :
32
- checks :
33
- name : Check versions
34
- runs-on : ubuntu-22.04
35
- permissions :
36
- packages : read
37
- contents : read
38
- strategy :
39
- fail-fast : false
40
- outputs :
41
- nginx_version : ${{ steps.var.outputs.nginx_version }}
42
- njs_version : ${{ steps.var.outputs.njs_version }}
43
- target_exists : ${{ steps.var.outputs.target_image_exists }}
44
- steps :
45
- - name : Checkout Repository
46
- uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
47
-
48
- - name : Login to GitHub Container Registry
49
- uses : docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
50
- with :
51
- registry : ghcr.io
52
- username : ${{ github.repository_owner }}
53
- password : ${{ secrets.GITHUB_TOKEN }}
54
-
55
- - name : Output Variables
56
- id : var
57
- run : |
58
- if [ -n "${{ inputs.nginx_version }}" ]; then
59
- nginx_v=${{ inputs.nginx_version }}
60
- else
61
- nginx_v=$(grep -m1 'FROM nginx:' <build/dependencies/Dockerfile.ubi | cut -d '@' -f1 | awk -F'[: ]' '{print $3}')
62
- fi
63
- target_image=${{ env.IMAGE_NAME }}:nginx-${nginx_v}
64
- if docker manifest inspect ${target_image}; then
65
- target_image_exists=true
66
- else
67
- target_image_exists=false
68
- fi
69
- docker pull nginx:$nginx_v || exit 1
70
- njs=$(docker run nginx:$nginx_v env | grep NJS_VERSION | cut -d= -f2)
71
- echo "> Outputs -------------------------------"
72
- echo "NJS_VERSION=$njs"
73
- echo "nginx_version=${nginx_v}"
74
- echo "njs_version=${njs}"
75
- echo "target_image_exists=${target_image_exists}"
76
- echo "nginx_version=${nginx_v}" >> $GITHUB_OUTPUT
77
- echo "njs_version=${njs}" >> $GITHUB_OUTPUT
78
- echo "target_image_exists=${target_image_exists}" >> $GITHUB_OUTPUT
79
-
80
24
build-binaries :
81
25
name : Build Binary Container Image
82
- if : ${{ needs.checks.outputs.target_exists != 'true' || inputs.force }}
83
- needs : checks
84
26
runs-on : ubuntu-22.04
85
27
permissions :
86
28
packages : write
87
29
contents : read
88
30
strategy :
89
31
fail-fast : false
32
+ matrix :
33
+ tag : ["ubi8", "ubi9"]
90
34
steps :
91
35
- name : Checkout Repository
92
36
uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -113,28 +57,22 @@ jobs:
113
57
images : |
114
58
name=${{ env.IMAGE_NAME }},enable=true
115
59
tags : |
116
- type=raw,value=nginx- ${{ needs.checks.outputs.nginx_version }},enable=true
60
+ type=raw,value=${{ matrix.tag }},enable=true
117
61
env :
118
62
DOCKER_METADATA_ANNOTATIONS_LEVELS : manifest,index
119
63
120
64
- name : Build and push
121
65
uses : docker/build-push-action@14487ce63c7a62a4a324b0bfb37086795e31c6c1 # v6.16.0
122
66
with :
123
- file : ./build/dependencies/Dockerfile.ubi
67
+ file : ./build/dependencies/Dockerfile.${{ matrix.tag }}
124
68
context : " ."
125
69
pull : true
126
- push : true
127
- # build multi-arch so that it can be mounted from any image
128
- # even though only ppc64le will contain binaries
129
70
platforms : " linux/amd64,linux/arm64"
130
71
tags : ${{ steps.meta.outputs.tags }}
131
72
labels : ${{ steps.meta.outputs.labels }}
132
73
annotations : ${{ steps.meta.outputs.annotations }}
133
- cache-from : type=gha,scope=nginx-ubi-ppc64le
134
- cache-to : type=gha,scope=nginx-ubi-ppc64le ,mode=max
74
+ cache-from : type=gha,scope=nginx-${{ matrix.tag }}
75
+ cache-to : type=gha,scope=nginx-${{ matrix.tag }} ,mode=max
135
76
target : final
136
77
sbom : false
137
78
provenance : mode=max
138
- build-args : |
139
- NGINX=${{ needs.checks.outputs.nginx_version }}
140
- NJS=${{ needs.checks.outputs.njs_version }}
0 commit comments