Skip to content

Unified bake target [3] #54

Unified bake target [3]

Unified bake target [3] #54

Workflow file for this run

name: Build Docker Images
on: push
jobs:
define-matrix:
runs-on: ubuntu-24.04
outputs:
cmake_versions: ${{ steps.matrix.outputs.cmake_versions }}
qts: ${{ steps.matrix.outputs.qts }}
steps:
- name: Define Matrix
id: matrix
run: |
echo "cmake_versions=$(cat <<JSON_EOF | jq -c
[
"3.30.6",
"3.31.2"
]
JSON_EOF
)" >> "$GITHUB_OUTPUT"
echo "qts=$(cat <<JSON_EOF | jq -c
[
{"version": "6.6.3", "arch": "gcc_64"},
{"version": "6.7.3", "arch": "linux_gcc_64"},
{"version": "6.8.1", "arch": "linux_gcc_64"}
]
JSON_EOF
)" >> "$GITHUB_OUTPUT"
cmake:
name: "CMake Docker builds"
needs: define-matrix
strategy:
fail-fast: false
matrix:
cmake_version: ${{ fromJSON(needs.define-matrix.outputs.cmake_versions) }}
qt: ${{ fromJSON(needs.define-matrix.outputs.qts) }}
runs-on: ubuntu-24.04
steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
tool-cache: true
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build
uses: docker/bake-action@v5
with:
push: ${{ github.event_name != 'pull_request' }}
env:
CMAKE_VERSIONS: |
[${{ toJSON(matrix.cmake_version) }}]
QTS: |
[${{ toJSON(matrix.qt) }}]
ALL_CMAKE_VERSIONS: ${{ needs.define-matrix.outputs.cmake_versions }}
ALL_QTS: ${{ needs.define-matrix.outputs.qts }}