-
Notifications
You must be signed in to change notification settings - Fork 0
141 lines (120 loc) · 4.45 KB
/
zxc-build-httpd-oidc-images.yaml
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
##
# Copyright (C) 2024 Hedera Hashgraph, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
##
name: "ZXC: Build Apache HTTPD OpenIDC Images"
on:
workflow_call:
inputs:
## The tag version to be used
tag-version:
description: "Tag Version:"
type: string
required: true
base-os-image:
description: "Operating System Image:"
type: string
required: false
default: "noble-20240801"
gcs-fuse-version:
description: "GCS Fuse Version:"
type: string
required: false
default: "2.4.0"
## Linux Architectures for Multi-Arch Builds
platforms:
description: "Platforms:"
type: string
required: false
default: "linux/amd64,linux/arm64"
dry-run-enabled:
description: "Perform Dry Run"
type: boolean
required: false
default: false
custom-job-label:
description: "Custom Job Label:"
type: string
required: false
default: "Build"
defaults:
run:
shell: bash
permissions:
id-token: write
contents: read
packages: write
jobs:
build-httpd-oidc-images:
name: ${{ inputs.custom-job-label || 'Build' }}
runs-on: swirldslabs-infrastructure-linux-medium
steps:
- name: Harden Runner
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
with:
egress-policy: audit
- name: Checkout Code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Setup QEmu Support
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0
- name: Setup Docker Buildx Support
uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3.6.1
with:
version: v0.16.2
driver-opts: network=host
- name: Show Docker Version
run: docker version
- name: Show Docker Info
run: docker info
- name: Docker Login (Github)
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
if: ${{ inputs.dry-run-enabled != true }}
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Calculate Docker Registry
id: registry
run: |
DOCKER_REGISTRY_PREFIX="ghcr.io/${{ github.repository }}"
IMG_RESULT="push"
if [[ "${{ inputs.dry-run-enabled }}" == "true" ]]; then
DOCKER_REGISTRY_PREFIX="local"
IMG_RESULT="cache"
fi
echo "prefix=${DOCKER_REGISTRY_PREFIX}" >>"${GITHUB_OUTPUT}"
echo "operation=${IMG_RESULT}" >>"${GITHUB_OUTPUT}"
- name: Calculate Source Date
id: commit
run: echo "source-date=$(git log -1 --pretty=%ct)" >> "${GITHUB_OUTPUT}"
- name: Calculate Docker Tag
id: docker-tag
run: |
TAG_VERSION="${{ inputs.tag-version }}"
echo "version=${TAG_VERSION//+/-}" >>"${GITHUB_OUTPUT}"
- name: Build Image
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6.7.0
with:
context: ${{ github.workspace }}/apache-httpd-oidc
platforms: ${{ inputs.platforms }}
push: ${{ steps.registry.outputs.operation == 'push' }}
load: ${{ steps.registry.outputs.operation == 'load' }}
tags: |
${{ steps.registry.outputs.prefix }}/apache-httpd-oidc:latest
${{ steps.registry.outputs.prefix }}/apache-httpd-oidc:${{ steps.docker-tag.outputs.version }}
${{ steps.registry.outputs.prefix }}/apache-httpd-oidc:${{ steps.docker-tag.outputs.version }}-${{ inputs.base-os-image }}
build-args: |
SOURCE_DATE_EPOCH=${{ steps.commit.outputs.source-date }}
UBUNTU_TAG=${{ inputs.base-os-image }}
GCS_FUSE_VERSION=${{ inputs.gcs-fuse-version }}