Merge pull request #267 from jenfransson/OMICSINT_H24 #103
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Push Docker Images for Labs | |
on: | |
push: | |
paths: | |
- .github/workflows/Build and Push Docker Images for Labs.yml | |
- 'session_ml/DeepLearningDataIntegration/**' | |
- 'session_ml/FeatureSelectionIntegrOMICs/**' | |
- 'session_ml/SingleCell/**' | |
- 'session_ml/SupervisedOMICsIntegration/**' | |
- 'session_ml/UnsupervisedOMICsIntegration/**' | |
- 'session_ml/UMAP_DataIntegration/**' | |
- 'session_gems/**' | |
- 'session_gsa/**' | |
- 'session_topology/**' | |
- 'session_nmf/**' | |
branches: | |
- OMICSINT_H24 | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
if: github.repository == 'NBISweden/workshop_omics_integration' | |
steps: | |
# Checkout the repository with full history (fetch-depth: 0) | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
# Set short commit hash | |
- name: Set short commit hash | |
run: echo "SHORT_SHA=${GITHUB_SHA::7}" >> $GITHUB_ENV | |
# Set up Docker Buildx for multi-platform builds | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
# Log in to Docker Hub | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | |
# Log in to GitHub Container Registry (GHCR) | |
- name: Log in to GHCR | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
# Determine which directories have changes | |
- name: Check for Changes | |
id: changes | |
run: | | |
echo "## Detecting changes in the repository..." | |
git fetch origin ${{ github.event.before }} | |
if git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -q '^session_ml/DeepLearningDataIntegration'; then | |
echo "deep_learning=true" >> $GITHUB_ENV | |
fi | |
if git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -q '^session_ml/FeatureSelectionIntegrOMICs'; then | |
echo "feature_selection=true" >> $GITHUB_ENV | |
fi | |
if git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -q '^session_ml/SingleCell'; then | |
echo "single_cell=true" >> $GITHUB_ENV | |
fi | |
if git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -q '^session_ml/UMAP_DataIntegration'; then | |
echo "umap_data_integration=true" >> $GITHUB_ENV | |
fi | |
if git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -q '^session_ml/SupervisedOMICsIntegration'; then | |
echo "supervised_omics_integration=true" >> $GITHUB_ENV | |
fi | |
if git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -q '^session_ml/UnsupervisedOMICsIntegration'; then | |
echo "unsupervised_omics_integration=true" >> $GITHUB_ENV | |
fi | |
if git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -q '^session_gems'; then | |
echo "gems=true" >> $GITHUB_ENV | |
fi | |
if git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -q '^session_gsa'; then | |
echo "gsa=true" >> $GITHUB_ENV | |
fi | |
if git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -q '^session_topology'; then | |
echo "topology=true" >> $GITHUB_ENV | |
fi | |
if git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -q '^session_nmf'; then | |
echo "nmf=true" >> $GITHUB_ENV | |
fi | |
# Conditionally build and push images for Deep Learning Lab | |
- name: Build and Push Docker Image for Deep Learning Lab | |
if: env.deep_learning == 'true' | |
uses: docker/build-push-action@v4 | |
with: | |
context: ./session_ml/DeepLearningDataIntegration | |
file: session_ml/DeepLearningDataIntegration/Dockerfile | |
platforms: linux/amd64 | |
push: true | |
no-cache: true | |
tags: | | |
docker.io/rasoolsnbis/omicsint_h24:session_ml_deep_learning_integration_amd_v.h24.${{ env.SHORT_SHA }} | |
ghcr.io/nbisweden/omicsint_h24:session_ml_deep_learning_integration_amd_v.h24.${{ env.SHORT_SHA }} | |
# Conditionally build and push images for Feature Selection Lab | |
- name: Build and Push Docker Image for Feature Selection Lab | |
if: env.feature_selection == 'true' | |
uses: docker/build-push-action@v4 | |
with: | |
context: ./session_ml/FeatureSelectionIntegrOMICs | |
file: session_ml/FeatureSelectionIntegrOMICs/Dockerfile | |
platforms: linux/amd64 | |
push: true | |
no-cache: true | |
tags: | | |
docker.io/rasoolsnbis/omicsint_h24:session_ml_feature_selection_amd_v.h24.${{ env.SHORT_SHA }} | |
ghcr.io/nbisweden/omicsint_h24:session_ml_feature_selection_amd_v.h24.${{ env.SHORT_SHA }} | |
# Conditionally build and push images for Single Cell Lab | |
- name: Build and Push Docker Image for Single Cell Lab | |
if: env.single_cell == 'true' | |
uses: docker/build-push-action@v4 | |
with: | |
context: ./session_ml/SingleCell | |
file: session_ml/SingleCell/Dockerfile | |
platforms: linux/amd64 | |
push: true | |
no-cache: true | |
tags: | | |
docker.io/rasoolsnbis/omicsint_h24:session_ml_single_cell_amd_v.h24.${{ env.SHORT_SHA }} | |
ghcr.io/nbisweden/omicsint_h24:session_ml_single_cell_amd_v.h24.${{ env.SHORT_SHA }} | |
# Conditionally build and push images for UMAP Data Integration Lab | |
- name: Build and Push Docker Image for UMAP Data Integration Lab | |
if: env.umap_data_integration == 'true' | |
uses: docker/build-push-action@v4 | |
with: | |
context: ./session_ml/UMAP_DataIntegration | |
file: session_ml/UMAP_DataIntegration/Dockerfile | |
platforms: linux/amd64 | |
push: true | |
no-cache: true | |
tags: | | |
docker.io/rasoolsnbis/omicsint_h24:session_ml_umap_data_integration_amd_v.h24.${{ env.SHORT_SHA }} | |
ghcr.io/nbisweden/omicsint_h24:session_ml_umap_data_integration_amd_v.h24.${{ env.SHORT_SHA }} | |
# Conditionally build and push images for Supervised OMICs Integration Lab | |
- name: Build and Push Docker Image for Supervised OMICs Integration Lab | |
if: env.supervised_omics_integration == 'true' | |
uses: docker/build-push-action@v4 | |
with: | |
context: ./session_ml/SupervisedOMICsIntegration | |
file: session_ml/SupervisedOMICsIntegration/Dockerfile | |
platforms: linux/amd64 | |
push: true | |
no-cache: true | |
tags: | | |
docker.io/rasoolsnbis/omicsint_h24:session_ml_supervised_omics_integration_amd_v.h24.${{ env.SHORT_SHA }} | |
ghcr.io/nbisweden/omicsint_h24:session_ml_supervised_omics_integration_amd_v.h24.${{ env.SHORT_SHA }} | |
# Conditionally build and push images for Unsupervised OMICs Integration Lab | |
- name: Build and Push Docker Image for Unsupervised OMICs Integration Lab | |
if: env.unsupervised_omics_integration == 'true' | |
uses: docker/build-push-action@v4 | |
with: | |
context: ./session_ml/UnsupervisedOMICsIntegration | |
file: session_ml/UnsupervisedOMICsIntegration/Dockerfile | |
platforms: linux/amd64 | |
push: true | |
no-cache: true | |
tags: | | |
docker.io/rasoolsnbis/omicsint_h24:session_ml_unsupervised_omics_integration_amd_v.h24.${{ env.SHORT_SHA }} | |
ghcr.io/nbisweden/omicsint_h24:session_ml_unsupervised_omics_integration_amd_v.h24.${{ env.SHORT_SHA }} | |
# Conditionally build and push images for Gems Lab | |
- name: Build and Push Docker Image for Gems Lab | |
if: env.gems == 'true' | |
uses: docker/build-push-action@v4 | |
with: | |
context: ./session_gems | |
file: session_gems/Dockerfile | |
platforms: linux/amd64 | |
push: true | |
no-cache: true | |
tags: | | |
docker.io/rasoolsnbis/omicsint_h24:session_gems_amd_v.h24.${{ env.SHORT_SHA }} | |
ghcr.io/nbisweden/omicsint_h24:session_gems_amd_v.h24.${{ env.SHORT_SHA }} | |
# Conditionally build and push images for GSA lab | |
- name: Build and Push Docker Image for GSA Lab | |
if: env.gsa == 'true' | |
uses: docker/build-push-action@v4 | |
with: | |
context: ./session_gsa | |
file: session_gsa/Dockerfile | |
platforms: linux/amd64 | |
push: true | |
no-cache: true | |
tags: | | |
docker.io/rasoolsnbis/omicsint_h24:session_gsa_amd_v.h24.${{ env.SHORT_SHA }} | |
ghcr.io/nbisweden/omicsint_h24:session_gsa_amd_v.h24.${{ env.SHORT_SHA }} | |
# Conditionally build and push images for Topology lab | |
- name: Build and Push Docker Image for Topology Lab | |
if: env.topology == 'true' | |
uses: docker/build-push-action@v4 | |
with: | |
context: ./session_topology | |
file: session_topology/Dockerfile | |
platforms: linux/amd64 | |
push: true | |
no-cache: true | |
tags: | | |
docker.io/rasoolsnbis/omicsint_h24:session_topology_amd_v.h24.${{ env.SHORT_SHA }} | |
ghcr.io/nbisweden/omicsint_h24:session_topology_amd_v.h24.${{ env.SHORT_SHA }} | |
# Conditionally build and push images for NMF lab | |
- name: Build and Push Docker Image for NMF Lab | |
if: env.nmf == 'true' | |
uses: docker/build-push-action@v4 | |
with: | |
context: ./session_nmf | |
file: session_nmf/Dockerfile | |
platforms: linux/amd64 | |
push: true | |
no-cache: true | |
tags: | | |
docker.io/rasoolsnbis/omicsint_h24:session_nmf_amd_v.h24.${{ env.SHORT_SHA }} | |
ghcr.io/nbisweden/omicsint_h24:session_nmf_amd_v.h24.${{ env.SHORT_SHA }} | |