Merge pull request #116 from rasools/OMICSINT_H24 #1
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: | |
- 'session_ml/DeepLearningDataIntegration/**' | |
- 'session_ml/FeatureSelectionIntegrOMICs/**' | |
- 'session_ml/SingleCell/**' | |
- 'session_gems/**' | |
branches: | |
- OMICSINT_H24 | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
if: github.repository == 'NBISweden/workshop_omics_integration' | |
steps: | |
# Checkout the repository | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
# 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..." | |
if git diff --name-only HEAD^ HEAD | grep -q 'session_ml/DeepLearningDataIntegration'; then | |
echo "deep_learning=true" >> $GITHUB_ENV | |
fi | |
if git diff --name-only HEAD^ HEAD | grep -q 'session_ml/FeatureSelectionIntegrOMICs'; then | |
echo "feature_selection=true" >> $GITHUB_ENV | |
fi | |
if git diff --name-only HEAD^ HEAD | grep -q 'session_ml/SingleCell'; then | |
echo "single_cell=true" >> $GITHUB_ENV | |
fi | |
if git diff --name-only HEAD^ HEAD | grep -q 'session_gems'; then | |
echo "gems=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 | |
ghcr.io/nbisweden/omicsint_h24:session_ml_deep_learning_integration_amd | |
# 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 | |
ghcr.io/nbisweden/omicsint_h24:session_ml_feature_selection_amd | |
# 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 | |
ghcr.io/nbisweden/omicsint_h24:session_ml_single_cell_amd | |
# 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 | |
ghcr.io/nbisweden/omicsint_h24:session_gems_amd |