Build llvm-mpich-image #5
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: Docker image build | |
run-name: Build ${{ inputs.image }} | |
on: | |
workflow_call: | |
inputs: | |
image: | |
description: Which image to build | |
required: true | |
type: string | |
push_image: | |
description: Push image to package registry | |
required: true | |
type: boolean | |
default: true | |
workflow_dispatch: | |
inputs: | |
image: | |
type: choice | |
description: Which image to build | |
required: true | |
default: "intel-impi-image" | |
options: | |
- "intel-impi-image" | |
- "gnu-ompi-image" | |
- "llvm-mpich-image" | |
push_image: | |
type: boolean | |
description: Push image to package registry | |
required: true | |
default: true | |
jobs: | |
build-single-image: | |
name: Build ${{ inputs.image }} | |
runs-on: ubuntu-latest | |
timeout-minutes: 300 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 2 | |
- uses: docker/setup-buildx-action@v3 | |
name: Set up Docker Buildx | |
id: buildx | |
- name: Create tag with current date | |
id: date | |
run: echo "date=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
ghcr.io/kmturbulenz/${{ inputs.image }} | |
tags: | | |
type=sha | |
type=raw,prefix=date-,value=${{ steps.date.outputs.date }} | |
- uses: docker/login-action@v3 | |
name: Login to Github Packages | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- uses: docker/build-push-action@v6 | |
name: Build image and push to GitHub Container Registry | |
with: | |
context: . | |
target: ${{ inputs.image }} | |
tags: ${{ steps.meta.outputs.tags }} | |
push: ${{ inputs.push_image }} |