Preparing release 2.10 #31
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 and Publish Docker Images | |
on: | |
push: | |
branches: | |
- 'master' | |
- 'main' | |
- '2.10' | |
tags: | |
- 'v*' | |
pull_request: | |
branches: | |
- 'master' | |
- 'main' | |
workflow_dispatch: | |
env: | |
REGISTRY: ghcr.io | |
permissions: | |
contents: read | |
packages: write | |
id-token: write | |
attestations: write | |
jobs: | |
build-spack: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
os: [{dir: AlmaLinux9,suffix: alma9}] | |
env: | |
IMAGE_NAME: mucoll-spack | |
steps: | |
- name: Free up disk space | |
run: rm -rf /opt/hostedtoolcache | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Docker buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Make owner name lowercase | |
run: | | |
echo "OWNER_LC=${OWNER,,}" >>${GITHUB_ENV} | |
env: | |
OWNER: '${{ github.repository_owner }}' | |
- name: Extract metadata for Docker | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ${{ env.REGISTRY }}/${{env.OWNER_LC}}/mucoll-dummy | |
- name: Build and Push | |
id: docker_build | |
uses: docker/build-push-action@v6 | |
with: | |
context: ./${{matrix.os.dir}} | |
file: ./${{matrix.os.dir}}/Dockerfile-spack | |
push: true | |
build-args: | | |
VERSION=${{ steps.meta.outputs.version }} | |
REPOSITORY=${{ env.REGISTRY }}/${{env.OWNER_LC}} | |
tags: ${{ env.REGISTRY }}/${{env.OWNER_LC}}/${{ env.IMAGE_NAME}}:${{steps.meta.outputs.version}}-${{matrix.os.suffix}} | |
labels: ${{ steps.meta.outputs.labels }} | |
- name: Generate artifact attestation | |
uses: actions/attest-build-provenance@v1 | |
with: | |
subject-name: ${{ env.REGISTRY }}/${{env.OWNER_LC}}/${{ env.IMAGE_NAME}} | |
subject-digest: ${{ steps.push.containerimage.digest }} | |
push-to-registry: true | |
build-base: | |
runs-on: ubuntu-latest | |
needs: build-spack | |
strategy: | |
matrix: | |
os: [{dir: AlmaLinux9,suffix: alma9}] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: lowercase owner name | |
run: | | |
echo "OWNER_LC=${OWNER,,}" >>${GITHUB_ENV} | |
env: | |
OWNER: '${{ github.repository_owner }}' | |
- name: Docker Meta | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ghcr.io/${{env.OWNER_LC}}/mucoll-dummy | |
- name: Build and Push | |
id: docker_build | |
uses: docker/build-push-action@v6 | |
with: | |
push: true | |
context: ./${{matrix.os.dir}} | |
file: ./${{matrix.os.dir}}/Dockerfile-base | |
build-args: | | |
VERSION=${{ steps.meta.outputs.version }} | |
REPOSITORY=ghcr.io/${{env.OWNER_LC}} | |
tags: ghcr.io/${{env.OWNER_LC}}/mucoll-base:${{steps.meta.outputs.version}}-${{matrix.os.suffix}} | |
build-sim: | |
runs-on: ubuntu-latest | |
needs: build-base | |
strategy: | |
matrix: | |
os: [{dir: AlmaLinux9,suffix: alma9}] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: lowercase owner name | |
run: | | |
echo "OWNER_LC=${OWNER,,}" >>${GITHUB_ENV} | |
env: | |
OWNER: '${{ github.repository_owner }}' | |
- name: Docker Meta | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ghcr.io/${{env.OWNER_LC}}/mucoll-dummy | |
- name: Build and Push | |
id: docker_build | |
uses: docker/build-push-action@v6 | |
with: | |
push: true | |
context: ./${{matrix.os.dir}} | |
file: ./${{matrix.os.dir}}/Dockerfile-sim | |
build-args: | | |
VERSION=${{ steps.meta.outputs.version }} | |
REPOSITORY=ghcr.io/${{env.OWNER_LC}} | |
tags: ghcr.io/${{env.OWNER_LC}}/mucoll-sim:${{steps.meta.outputs.version}}-${{matrix.os.suffix}} |