Skip to content

Add compiler to build matrix #7

Add compiler to build matrix

Add compiler to build matrix #7

Workflow file for this run

name: Docker
on:
push:
paths:
- 'docker/**'
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{github.repository}}
jobs:
docker:
name: build (Ubuntu ${{matrix.ubuntu}}, OpenCV ${{matrix.opencv}}, ${{matrix.compiler.label}})
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
strategy:
matrix:
ubuntu: ['20.04', '22.04']
opencv: ['4.x']
compiler:
- { cmd: 'g++', label: 'gcc' }
- { cmd: 'clang', label: 'clang' }
steps:
- name: Check out main project
uses: actions/checkout@v4
- name: Log in to the Container Registry
uses: docker/login-action@v3
with:
registry: ${{env.REGISTRY}}
username: ${{github.actor}}
password: ${{secrets.GITHUB_TOKEN}}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{env.REGISTRY}}/${{env.IMAGE_NAME}}
- name: Build and push
uses: docker/build-push-action@v6
with:
push: true
context: docker
tags: ${{env.REGISTRY}}/${{env.IMAGE_NAME}}:ubuntu-${{matrix.ubuntu}}-opencv-${{matrix.opencv}}-${{matrix.compiler.label}}
labels: ${{steps.meta.outputs.labels}}
build-args: |
OPENCV_TAG=${{matrix.opencv}}
UBUNTU_TAG=${{matrix.ubuntu}}
COMPILER=${{matrix.compiler.cmd}}