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

Add docker deployment action. #671

Merged
merged 2 commits into from
Feb 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
54 changes: 54 additions & 0 deletions .github/workflows/docker_deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Build and deploy Docker image

on:
push:
branches:
- 'main'
release:
types: [published]

jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: true
fetch-depth: 0

-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
-
name: Build and push stable release
if: ${{ github.event_name == 'release' && startsWith(github.event.ref, 'refs/tags') }}
id: docker_build_release
uses: docker/build-push-action@v2
with:
push: true
tags: molpopgen/fwdpy11:stable
file: deployment/docker/Dockerfile
context: .
-
name: Build and push from main
if: github.ref == 'refs/heads/main'
id: docker_build_main
uses: docker/build-push-action@v2
with:
push: true
tags: molpopgen/fwdpy11:latest
file: deployment/docker/Dockerfile
context: .
-
name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
3 changes: 2 additions & 1 deletion deployment/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -qq -y install cmak
libgsl-dev \
python3 \
python3-pip \
&& rm -rf /var/lib/apt/lists/*
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf build

RUN python3 -m pip install --no-cache-dir .