Skip to content

github-docker

github-docker #88

Workflow file for this run

name: github-docker
on:
push:
branches:
- 'docker*'
schedule:
- cron: '0 */12 * * *'
permissions:
contents: read
packages: write
jobs:
build-master-docker:
if: (github.event_name == 'schedule' && github.repository == 'dealii/dealii') || github.event_name != 'schedule'
name: build master docker ${{ matrix.ubuntu_version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ubuntu_version: [focal, jammy]
# Use only 1 job to build, as more jobs
# would starve the github machine for memory.
include:
- n_jobs: 1
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push Docker image of master ${{ matrix.ubuntu_version }}
uses: docker/build-push-action@v5
with:
context: ./contrib/docker/
cache-from: type=registry,ref=dealii/dependencies:${{ matrix.ubuntu_version }}
cache-to: type=inline
build-args: |
IMG=${{ matrix.ubuntu_version }}
NJOBS=${{ matrix.n_jobs }}
VER=master
push: ${{ github.event_name == 'schedule' }}
tags: dealii/dealii:master-${{ matrix.ubuntu_version }}