Update docker image #64
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: Update docker image | |
on: | |
workflow_dispatch: # Trigger by hand from the UI | |
inputs: | |
branch: | |
type: choice | |
description: branch to build the container from | |
options: | |
- develop | |
push: | |
branches: | |
- develop | |
jobs: | |
build-and-release-docker-image: | |
name: Builds a dockerimage with the fenics adapter of preCICE | |
runs-on: ubuntu-latest | |
env: | |
docker_username: precice | |
steps: | |
- name: Set branch name for manual triggering | |
if: github.event_name == 'workflow_dispatch' | |
shell: bash | |
run: | | |
echo "ADAPTER_REF=${{ inputs.branch }}" >> $GITHUB_ENV | |
- name: Set branch name for on pull triggering | |
if: github.event_name != 'pull_request' && github.event_name != 'workflow_dispatch' | |
shell: bash | |
run: | | |
echo "ADAPTER_REF=${{ github.ref_name }}" >> $GITHUB_ENV | |
- name: Set PYTHON_BINDINGS_REF and the TAG depending on branch | |
shell: bash | |
run: | | |
echo "PYTHON_BINDINGS_REF=${{ env.ADAPTER_REF }}" >> "$GITHUB_ENV" | |
echo "TAG=${{ env.ADAPTER_REF }}" >> "$GITHUB_ENV" | |
echo "Building TAG: ${{ env.ADAPTER_REF }}" | |
- 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 push Dockerfile | |
uses: docker/build-push-action@v2 | |
with: | |
push: true | |
file: "./tools/releasing/packaging/docker/Dockerfile" | |
tags: ${{ env.docker_username }}/fenics-adapter:${{ env.TAG }} | |
build-args: | | |
FENICS_ADAPTER_REF=${{ env.ADAPTER_REF }} | |
PYTHON_BINDINGS_REF=${{ env.PYTHON_BINDINGS_REF }} |