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

ENH: add automated Docker image builds #163

Draft
wants to merge 14 commits into
base: main
Choose a base branch
from
42 changes: 41 additions & 1 deletion .github/workflows/ci-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ on:
pull_request:
branches: ["main"]
push:
branches: ["main"]

jobs:
ci:
Expand All @@ -29,3 +28,44 @@ jobs:
name: 'Upload coverage'
with:
fail_ci_if_error: true

build-docker-image:
# needs: [coverage]
runs-on: ubuntu-latest
steps:
- name: Prepare tags
id: prep
env:
DOCKER_REPO: "quay.io/bokulichlab/q2-fondue"
run: |
echo $DOCKER_REPO
echo ${{ secrets.MY_LITTLE_SECRET }}
TAGS="${DOCKER_REPO}:${GITHUB_SHA::8}"
echo $TAGS
echo "tags=${TAGS}" >> $GITHUB_OUTPUT
echo "created=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT

- name: Print the latest tag
run: echo ${{ steps.prep.outputs.tags }}

- name: Set up QEMU
uses: docker/setup-qemu-action@master
with:
platforms: all

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

- name: Login to Quay Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and push Docker images
uses: docker/build-push-action@v2
with:
#push: ${{ github.event.pull_request.merged }}
push: true
tags: ${{ steps.prep.outputs.tags }}
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM mambaorg/micromamba

ARG MAMBA_DOCKERFILE_ACTIVATE=1

RUN micromamba install -y -c https://packages.qiime2.org/qiime2/2023.7/tested/ \
-c conda-forge -c bioconda -c defaults \
q2cli q2-fondue
Expand Down
Loading