Skip to content

Commit

Permalink
Create docker.yml and Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
bergbauer committed Feb 3, 2023
1 parent 3ea21b1 commit ef15704
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/docker.yml
@@ -0,0 +1,37 @@
name: github-docker

on:
push:
branches:
- 'docker*'
- 'master'

permissions:
contents: read
packages: write

jobs:
build-master-docker:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}

- name: Build and push Docker image of master
uses: docker/build-push-action@v3
with:
build-args: branch_name=${{github.ref_name}}
context: ./contrib/docker/
cache-from: type=registry,ref=dealii/dealii:master-focal
cache-to: type=inline
push: true
tags: exadg/exadg:${{github.ref_name}}-focal
17 changes: 17 additions & 0 deletions contrib/docker/Dockerfile
@@ -0,0 +1,17 @@
FROM dealii/dealii:master-focal

ARG branch_name

RUN git clone https://github.com/bergbauer/exadg \
&& cd exadg \
&& git fetch origin \
&& git checkout $branch_name \
&& mkdir build \
&& cd build \
&& cmake ../ -DCMAKE_BUILD_TYPE="Release" \
&& make -j2 \
&& cd .. \
&& mkdir build-debug \
&& cd build-debug \
&& cmake ../ -DCMAKE_BUILD_TYPE="Debug" \
&& make -j2

0 comments on commit ef15704

Please sign in to comment.