-
Notifications
You must be signed in to change notification settings - Fork 35
234 lines (212 loc) · 9.85 KB
/
Build and Push Docker Images for Labs.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
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 }}