#32: fix error in github action #25
Workflow file for this run
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 & push base Docker image | |
on: | |
# Push event. Useful for tests. | |
push: | |
branches: | |
- 32-vt-tv-improve-ci | |
# Dispatch event (manually triggered) | |
# workflow_dispatch: | |
# inputs: | |
# BUILD_CONFIG: | |
# type: choice | |
# description: The configuration to build as a combination of os, compiler, vtk and python versions | |
# options: | |
# - ubuntu_22.04-gcc_11-vtk_9.2.2-py_3.8 | |
# - ubuntu_22.04-clang_11-vtk_9.2.2-py_3.8 | |
# default: ubuntu_22.04-gcc_11-vtk_9.2.2-py_3.8 | |
# Note: in Extract build configuration stage please also changes { matrix.BUILD_CONFIG } to { inputs.BUILD_CONFIG }, and comment the matrix to disable. | |
jobs: | |
push_to_registry: | |
name: Build & Push | |
runs-on: ubuntu-latest | |
# Matrix for push event. To comment when using the dispatch event. | |
strategy: | |
matrix: | |
BUILD_CONFIG: | |
- ubuntu_22.04-gcc_11-vtk_9.2.2-py_3.8 | |
- ubuntu_22.04-clang_14-vtk_9.2.2-py_3.8 | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v4 | |
- name: Extract build configuration | |
# If workflow dispatch event replace `matrix.BUILD_CONFIG` by `inputs.BUILD_CONFIG` | |
run: | | |
IFS='_-' read -r -a CONFIG <<< "${{ matrix.BUILD_CONFIG }}" | |
echo "BASE_IMAGE=${CONFIG[0]}:${CONFIG[1]}" >> $GITHUB_ENV | |
echo "CC=${CONFIG[2]}-${CONFIG[3]}" >> $GITHUB_ENV | |
if [[ "${CONFIG[2]}" == "gcc" ]]; then | |
echo "CXX=g++-${CONFIG[3]}" >> $GITHUB_ENV | |
elif [[ "${CONFIG[2]}" == "clang" ]]; then | |
echo "CXX=clang++-${CONFIG[3]}" >> $GITHUB_ENV | |
else | |
exit 1 | |
fi | |
echo "VTK_VERSION=${CONFIG[5]}" >> $GITHUB_ENV | |
echo "PYTHON_VERSION=${CONFIG[7]}" >> $GITHUB_ENV | |
echo "DOCKER_TAG=${{ matrix.BUILD_CONFIG }}" >> $GITHUB_ENV | |
- name: Build configuration | |
run: | | |
echo "Base image: $BASE_IMAGE" | |
echo "C Compiler: $CC" | |
echo "CXX Compiler: $CXX" | |
echo "VTK: $VTK_VERSION" | |
echo "Python: $PYTHON_VERSION" | |
echo "Docker tag: $DOCKER_TAG" | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and push to Docker Hub | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
build-args: | | |
BASE_IMAGE=${{ env.BASE_IMAGE }} | |
CC=${{ env.CC }} | |
CXX=${{ env.CXX }} | |
VTK_VERSION=${{ env.VTK_VERSION }} | |
PYTHON_VERSION=${{ env.PYTHON_VERSION }} | |
file: ci/docker/make-base.dockerfile | |
push: true | |
tags: pierrpebay/vt-tv:${{ env.DOCKER_TAG }} |