Skip to content

Build and push access-nri/build images #85

Build and push access-nri/build images

Build and push access-nri/build images #85

name: Build and push access-nri/build images
on:
workflow_dispatch:
inputs:
spack-packages-version:
required: true
type: string
default: "main"
description: "Either a git tag or branch name for the ACCESS-NRI/spack_packages repository, which defaults to the main branch"
model:
required: true
type: choice
default: "all"
options:
- access-om2
- access-om3
- all
jobs:
generate-matrix:
name: Generate Matrix of compilers and models
runs-on: ubuntu-latest
outputs:
models: ${{ steps.get-model.outputs.models }}
compilers: ${{ steps.get-compiler.outputs.compilers }}
steps:
- uses: actions/checkout@v3
- name: Determine correct model(s) to build
id: get-model
run: |
if [[ "${{ inputs.model }}" = "all" ]]; then
echo "models=['access-om2', 'access-om3']" >> $GITHUB_OUTPUT
else
echo "models=['${{ inputs.model }}']" >> $GITHUB_OUTPUT
fi
- name: Determine compilers to build
id: get-compiler
run: echo "compilers=$(jq -c . containers/compilers.json)" >> $GITHUB_OUTPUT
dependency-image-workflow:
name: Create dependency images based on varied compilers and models
needs:
- generate-matrix
strategy:
fail-fast: false
matrix:
compiler: ${{ fromJson(needs.generate-matrix.outputs.compilers) }}
uses: access-nri/build-ci/.github/workflows/dependency-image-pipeline.yml@main
with:
compiler-name: ${{ matrix.compiler.name }}
compiler-package: ${{ matrix.compiler.package }}
compiler-version: ${{ matrix.compiler.version }}
spack-packages-version: ${{ inputs.spack-packages-version }}
models: ${{ needs.generate-matrix.outputs.models }}
permissions:
packages: write
contents: read
secrets: inherit