Build OpenTracing Dependency #18
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build OpenTracing Dependency | |
on: | |
schedule: | |
- cron: "30 4 * * 1" # run Mon at 04:30 UTC | |
workflow_dispatch: | |
inputs: | |
nginx_version: | |
type: string | |
description: "NGINX Version to build OT for" | |
required: false | |
env: | |
PLATFORMS: "linux/arm,linux/amd64,linux/arm64,linux/ppc64le,linux/s390x" | |
concurrency: | |
group: ${{ github.ref_name }}-ot-build | |
cancel-in-progress: true | |
permissions: | |
contents: read | |
jobs: | |
build-docker: | |
name: Build Docker Image | |
runs-on: ubuntu-24.04 | |
permissions: | |
packages: write | |
contents: read | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [debian, alpine] | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
with: | |
repository: opentracing-contrib/nginx-opentracing | |
ref: master | |
- name: Variables | |
id: var | |
run: | | |
if [ -n "${{ inputs.nginx_version }}" ]; then | |
nginx_version="${{ inputs.nginx_version }}" | |
else | |
nginx_version=$(grep -m1 'FROM nginx:' <Dockerfile | awk -F'[: ]' '{print $3}') | |
fi | |
echo "nginx_version=${nginx_version}" | |
echo "nginx_version=${nginx_version}" >> $GITHUB_OUTPUT | |
- name: Setup QEMU | |
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0 | |
with: | |
platforms: arm,arm64,ppc64le,s390x | |
- name: Docker Buildx | |
uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3.6.1 | |
with: | |
buildkitd-flags: --debug | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
if: github.event_name != 'pull_request' | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1 | |
with: | |
images: | | |
name=ghcr.io/nginxinc/dependencies/nginx-ot,enable=true | |
flavor: suffix=${{ matrix.os != 'debian' && format('-{0}', matrix.os) || '' }},onlatest=true | |
tags: | | |
type=raw,value=nginx-${{ steps.var.outputs.nginx_version }},enable=true | |
env: | |
DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest,index | |
- name: Build and push | |
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6.7.0 | |
with: | |
file: ./Dockerfile | |
context: "." | |
pull: true | |
push: true | |
platforms: "linux/arm,linux/amd64,linux/arm64,linux/ppc64le,linux/s390x" | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
annotations: ${{ steps.meta.outputs.annotations }} | |
cache-from: type=gha,scope=${{ matrix.os }} | |
cache-to: type=gha,scope=${{ matrix.os }},mode=max | |
target: final | |
sbom: false | |
provenance: mode=max | |
build-args: | | |
BUILD_OS=${{ matrix.os }} | |
NGINX_VERSION=${{ steps.var.outputs.nginx_version }} |