Skip to content

Docker build

Docker build #19

Workflow file for this run

name: Docker build
on:
push:
tags: v*
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
environment: Docker
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Determine version tag
run: echo "VERSION_TAG=`git describe --tags | cut -c 2-`" >> $GITHUB_ENV
- name: Display version tag
run: echo Version is ${{ env.VERSION_TAG }}
- name: Login to Dockerhub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
with:
platforms: all
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
builder: ${{ steps.buildx.outputs.name }}
context: ./genetIC
file: ./genetIC/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: apontzen/genetic:${{ env.VERSION_TAG }}, apontzen/genetic:latest
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
- name: Run tests
run: |
docker pull apontzen/genetic:latest
docker run --rm -v `pwd`:/genetic_repository/ -e IC=/genetIC/genetIC -w /genetic_repository/genetIC/tests --entrypoint bash apontzen/genetic run_tests.sh
docker run --rm -v `pwd`:/genetic_repository/ -e IC=/genetIC/genetIC -w /genetic_repository/genetIC/tests --entrypoint bash apontzen/genetic run_mapper_tests.sh