|
| 1 | +name: Build moose-mpi |
| 2 | +description: Builds the moose-mpi docker container |
| 3 | + |
| 4 | +inputs: |
| 5 | + registry-token: |
| 6 | + description: The token for pushing to the registry |
| 7 | + required: true |
| 8 | + variant: |
| 9 | + description: The variant to build |
| 10 | + required: true |
| 11 | + type: choice |
| 12 | + options: |
| 13 | + - clang |
| 14 | + - clamg_min |
| 15 | + - gcc_min |
| 16 | + - intel |
| 17 | + - rocky8 |
| 18 | + - rocky9 |
| 19 | + from: |
| 20 | + description: The base container to build from |
| 21 | + required: false |
| 22 | + default: '' |
| 23 | + |
| 24 | +outputs: |
| 25 | + tag: |
| 26 | + description: The built container tag |
| 27 | + value: ${{ steps.meta.outputs.tags }} |
| 28 | + |
| 29 | +runs: |
| 30 | + using: composite |
| 31 | + steps: |
| 32 | + - name: Log in to GHCR |
| 33 | + uses: docker/login-action@v4 |
| 34 | + with: |
| 35 | + registry: ghcr.io |
| 36 | + username: ${{ github.repository_owner }} |
| 37 | + password: ${{ inputs.registry-token }} |
| 38 | + - name: Generate moose-mpi tag |
| 39 | + id: meta |
| 40 | + uses: docker/metadata-action@v6 |
| 41 | + with: |
| 42 | + images: ghcr.io/${{ github.repository }}/pr-moose-mpi-${{ inputs.variant }} |
| 43 | + tags: type=ref,event=pr |
| 44 | + - name: Form build args |
| 45 | + id: build_args |
| 46 | + shell: bash |
| 47 | + run: | |
| 48 | + variant="${{ inputs.variant }}" |
| 49 | + base_image= |
| 50 | + case "$variant" in |
| 51 | + "clang") |
| 52 | + base_image=ghcr.io/idaholab/moose-mpibase/rocky:8.10-clang20.1.8-mpich5.0.1_2026.04.14 |
| 53 | + ;; |
| 54 | + "clang_min") |
| 55 | + base_image=ghcr.io/idaholab/moose-mpibase/rocky:8.10-clang14.0.6-mpich5.0.1_2026.04.12 |
| 56 | + ;; |
| 57 | + "gcc_min") |
| 58 | + base_image=ghcr.io/idaholab/moose-mpibase/rocky:8.10-gcc9.2.1-mpich5.0.1_2026.04.12 |
| 59 | + ;; |
| 60 | + "intel") |
| 61 | + base_image=ghcr.io/idaholab/moose-mpibase/rocky:8.10-oneapi2025.3.3-mpich4.3.2_2026.04.12 |
| 62 | + ;; |
| 63 | + "rocky8") |
| 64 | + base_image=ghcr.io/idaholab/moose-mpibase/rocky:8.10-gcc13.3.1-mpich5.0.1-openmpi5.0.10_2026.04.12 |
| 65 | + ;; |
| 66 | + "rocky9") |
| 67 | + base_image=ghcr.io/idaholab/moose-mpibase/rocky:9.7-gcc13.3.1-mpich4.3.2-openmpi5.0.10_2026.04.12 |
| 68 | + ;; |
| 69 | + *) |
| 70 | + echo "::error:Unknown variant ${variant}" |
| 71 | + ;; |
| 72 | + { |
| 73 | + echo "build_args<<EOF" |
| 74 | + echo "BASE_IMAGE=${base_image}" |
| 75 | + echo "EOF" |
| 76 | + } >> $GITHUB_OUTPUT |
| 77 | + - name: Build moose-mpi |
| 78 | + uses: docker/build-push-action@v7 |
| 79 | + with: |
| 80 | + context: ./ |
| 81 | + file: docker/moose-mpi/Dockerfile |
| 82 | + push: true |
| 83 | + tags: ${{ steps.meta.outputs.tags }} |
| 84 | + cache-from: type=registry,ref=${{ steps.meta.outputs.tags }} |
| 85 | + build-args: | |
| 86 | + BUILD_JOBS=4 |
| 87 | + ${{ steps.build_args.outputs.build_args }} |
0 commit comments