Skip to content

Build all Docker images #1

Build all Docker images

Build all Docker images #1

# This is a workflow to build and optionally push all module Docker images
#
# The action works by use a GitHub matrix to build all images in parallel.
# The modules that will have their Docker images built are specified in the matrix variable `module`.
# To add modules, update the `module` matrix in the `build-docker-modules` job to include the module directory name.
#
# This workflow will run on:
# - Manual trigger
# - Periodic scheduled runs
# - Tagged version releases
name: Build all Docker images
on:
schedule:
# run monthly on the 1st
- cron: "0 0 1 * *"
push:
# build and push all on tagged release
tags:
- "v*.*.*"
workflow_dispatch:
inputs:
push-ecr:
description: "Push to AWS ECR"
type: boolean
required: true
jobs:
build-docker-modules:
name: Build Docker Images
strategy:
fail-fast: false
matrix:
##### Add all modules with active docker images here ####
module:
- hello-R
- hello-python
- simulate-sce
- cell-type-ewings
- doublet-detection
uses: ./.github/workflows/build-push-docker-module.yml
if: github.repository_owner == 'AlexsLemonade'
with:
module: ${{ matrix.module }}
# push if the workflow was triggered for scheduled build or push, or if the user requested it
push-ecr: ${{ github.event_name == 'schedule'|| github.event_name == 'push' || inputs.push-ecr }}
check-jobs:
name: Check Job Status
if: always()
needs:
- build-docker-modules
runs-on: ubuntu-latest
steps:
- name: Checkout template file
uses: actions/checkout@v4
with:
sparse-checkout: |
.github/cron-issue-templates/all-docker-issue-template.md
sparse-checkout-cone-mode: false
- name: Post issue with failed module images
if: contains(needs.*.result, 'failure')
uses: peter-evans/create-issue-from-file@v5
with:
title: Analysis module failing in CI
content-filepath: |
.github/cron-issue-templates/all-docker-issue-template.md
labels: |
OpenScPCA admin
docker
ci
- name: Check for failures or cancelled jobs
if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
run: echo "Job failed" && exit 1