Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OT dependency build #5919

Merged
merged 10 commits into from
Jul 4, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 96 additions & 0 deletions .github/workflows/build-ot-dependency.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: Build OpenTracing Dependency

on:
# push:
# branches:
# - "ot-build"
workflow_dispatch:
inputs:
nginx_version:
type: string
description: "NGINX Version to build"
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

jobs:
build-docker:
name: Build Docker Image
runs-on: ubuntu-22.04
permissions:
packages: write
contents: read
strategy:
fail-fast: false
matrix:
os: [debian, alpine]
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
repository: opentracing-contrib/nginx-opentracing
ref: master

- name: Variables
id: var
run: |
if [ -z "${{ inputs.nginx_version }}" ]; then
nginx_version="${{ inputs.nginx_version }}"
else
nginx_version=$(grep -m1 'ARG BUILD_NGINX_VERSION=' <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@v3
with:
platforms: arm,arm64,ppc64le,s390x

- name: Docker Buildx
uses: docker/setup-buildx-action@v3
with:
buildkitd-flags: --debug

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
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@v5
with:
images: |
name=ghcr.io/nginx/nic-ot-dependency,enable=true
flavor: suffix=${{ matrix.os != 'debian' && '-' || '' }}${{ matrix.os != 'debian' && matrix.os || '' }},onlatest=true
oseoin marked this conversation as resolved.
Show resolved Hide resolved
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@v5
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 }}