Skip to content

ENH: add automated Docker image builds #15

ENH: add automated Docker image builds

ENH: add automated Docker image builds #15

Workflow file for this run

name: CI
on:
pull_request:
branches: ["main"]
push:
branches: ["main"]
jobs:
ci:
uses: qiime2/distributions/.github/workflows/lib-ci-dev.yaml@dev
with:
distro: shotgun
additional-reports-path: ./coverage.xml
additional-reports-name: coverage
coverage:
needs: [ci]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v3
name: 'Fetch coverage from builds'
with:
name: ${{ needs.ci.outputs.additional-reports-name }}
path: ${{ needs.ci.outputs.additional-reports-path }}
- uses: codecov/codecov-action@v3
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 ${DOCKER_REPO}
TAGS="${DOCKER_REPO}:${GITHUB_SHA::8}"
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:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm/v6
push: ${{ github.event.pull_request.merged }}
tags: ${{ steps.prep.outputs.tags }}