Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated dockerfile & added release workflow #11

Merged
merged 6 commits into from
Aug 18, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Update docker image

on:
workflow_dispatch: # Trigger by hand from the UI
push:
branches:
- develop

jobs:
build-and-release-docker-image:
name: Builds a dockerimage with the FEniCSx and its adapter
runs-on: ubuntu-latest
env:
docker_username: precice
steps:
- name: Get branch name
if: github.event_name != 'pull_request'
shell: bash
run: echo "branch=$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_ENV
- name: Checkout Repository
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ env.docker_username }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and export to Docker
uses: docker/build-push-action@v2
with:
load: true
file: "./tools/releasing/packaging/docker/Dockerfile"
tags: ${{ env.docker_username }}/fenicsx-adapter:${{ env.branch }},${{ env.docker_username }}/fenicsx-adapter:latest
build-args: |
branch=${{ env.branch }}
- name: Test adapter
run: |
docker run --rm ${{ env.docker_username }}/fenicsx-adapter:latest python3 -c "import fenicsxprecice"
- name: Build and push Dockerfile
uses: docker/build-push-action@v2
with:
push: true
file: "./tools/releasing/packaging/docker/Dockerfile"
tags: ${{ env.docker_username }}/fenicsx-adapter:${{ env.branch }},${{ env.docker_username }}/fenicsx-adapter:latest
build-args: |
branch=${{ env.branch }}
11 changes: 7 additions & 4 deletions tools/releasing/packaging/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
# Dockerfile to build a ubuntu image containing the installed Debian package of a release
# Dockerfile to build a ubuntu image containing the fenicsx-adapter. Based on the preCICE Python bindings
# then we add the official package of FEniCSx and get the adapter.
ARG branch=develop
ARG from=precice/python-bindings:${branch}
FROM $from

# Install FEniCSx
USER root
# Installing necessary dependencies
## TODO
RUN add-apt-repository ppa:fenics-packages/fenics -y
RUN apt update
RUN apt install fenicsx -y

USER precice

Expand All @@ -16,5 +19,5 @@ RUN python3 -m pip install --user --upgrade pip
ARG CACHEBUST
ARG branch=develop

# Building fenics-adapter
# Building fenicsx-adapter
RUN python3 -m pip install --user git+https://github.com/precice/fenicsx-adapter.git@$branch