... #16
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: Debuntu images | |
on: | |
schedule: [ { cron: "50 23 * * 0" } ] # run every Sunday 23h50 | |
push: { branches: [ main, 'v*' ] } | |
pull_request: | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
debuntu: | |
strategy: | |
fail-fast: false | |
matrix: | |
base: ['ubuntu/jammy', 'ubuntu/rolling', 'debian/oldstable', 'debian/unstable'] | |
mpi: ['openmpi', 'mpich'] | |
variant: ['mini', 'all', 'pdi'] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Free space | |
uses: jlumbroso/free-disk-space@main | |
with: { tool-cache: true } | |
- name: Login on GHCR | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Setup BuildX | |
uses: docker/setup-buildx-action@v3 | |
- name: Compute tag, distro & version | |
id: info | |
run: | | |
echo "tags<<TAGS_LIST_EOF" >> "${GITHUB_OUTPUT}" | |
echo "ghcr.io/pdidev/${{ matrix.base }}/${{ matrix.mpi }}/${{ matrix.variant }}" >> "${GITHUB_OUTPUT}" | |
echo "ghcr.io/pdidev/${{ matrix.base }}/${{ matrix.mpi }}/${{ matrix.variant }}:${GITHUB_SHA:0:7}" >> "${GITHUB_OUTPUT}" | |
if [ 'true' = "${{ github.event_name == 'push' || github.event_name == 'schedule' }}" ] | |
then | |
echo "ghcr.io/pdidev/${{ matrix.base }}/${{ matrix.mpi }}/${{ matrix.variant }}:${{ github.ref_name }}" >> "${GITHUB_OUTPUT}" | |
fi | |
echo "TAGS_LIST_EOF" >> "${GITHUB_OUTPUT}" | |
BASE="${{ matrix.base }}" | |
echo "distro=${BASE%/*}" | |
echo "distro=${BASE%/*}" >> "${GITHUB_OUTPUT}" | |
echo "distro_version=${BASE##*/}" | |
echo "distro_version=${BASE##*/}" >> "${GITHUB_OUTPUT}" | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
cache-from: "ghcr.io/pdidev/test_env/cache/${{ matrix.base }}/${{ matrix.mpi }}/${{ matrix.variant }}" | |
cache-to: "ghcr.io/pdidev/test_env/cache/${{ matrix.base }}/${{ matrix.mpi }}/${{ matrix.variant }}" | |
build-args: | | |
MPI=${{ matrix.mpi }} | |
DISTRO=${{ steps.info.outputs.distro }} | |
DISTRO_VERSION=${{ steps.info.outputs.distro_version }} | |
tags: | | |
${{ steps.info.outputs.tags }} | |
context: "{{defaultContext}}:debuntu/${{ matrix.variant }}" | |
push: true |