Skip to content

Configure build matrix #1

Configure build matrix

Configure build matrix #1

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}})
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
strategy:
matrix:
ubuntu: ['20.04', '22.04']
opencv: ['4.x']
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.IMAGE_NAME}}:ubuntu-${{matrix.ubuntu}}-opencv-${{matrix.opencv}}
labels: ${{steps.meta.outputs.labels}}
build-args: |
OPENCV_TAG=${{matrix.opencv}}
UBUNTU_TAG=${{matrix.ubuntu}}