|
a |
|
b/.github/workflows/ci.yml |
|
|
1 |
name: Docker Build and Push |
|
|
2 |
on: |
|
|
3 |
# Trigger after RELEASE workflow completes |
|
|
4 |
workflow_run: |
|
|
5 |
workflows: ["RELEASE"] |
|
|
6 |
types: |
|
|
7 |
- completed |
|
|
8 |
branches: |
|
|
9 |
- main |
|
|
10 |
# Keep existing triggers for flexibility |
|
|
11 |
# push: |
|
|
12 |
# branches: |
|
|
13 |
# - main |
|
|
14 |
# workflow_dispatch: |
|
|
15 |
|
|
|
16 |
jobs: |
|
|
17 |
# Detect which modules have changed |
|
|
18 |
changes: |
|
|
19 |
runs-on: ubuntu-latest |
|
|
20 |
outputs: |
|
|
21 |
talk2biomodels: ${{ steps.filter.outputs.talk2biomodels }} |
|
|
22 |
talk2scholars: ${{ steps.filter.outputs.talk2scholars }} |
|
|
23 |
talk2aiagents4pharma: ${{ steps.filter.outputs.talk2aiagents4pharma }} |
|
|
24 |
talk2knowledgegraphs: ${{ steps.filter.outputs.talk2knowledgegraphs }} |
|
|
25 |
app: ${{ steps.filter.outputs.app }} |
|
|
26 |
|
|
|
27 |
steps: |
|
|
28 |
- name: Checkout Repository |
|
|
29 |
uses: actions/checkout@v4 |
|
|
30 |
with: |
|
|
31 |
fetch-depth: 0 |
|
|
32 |
|
|
|
33 |
- name: Check for changes |
|
|
34 |
uses: dorny/paths-filter@v2 |
|
|
35 |
id: filter |
|
|
36 |
with: |
|
|
37 |
filters: | |
|
|
38 |
talk2biomodels: |
|
|
39 |
- 'aiagents4pharma/talk2biomodels/**' |
|
|
40 |
talk2scholars: |
|
|
41 |
- 'aiagents4pharma/talk2scholars/**' |
|
|
42 |
talk2aiagents4pharma: |
|
|
43 |
- 'aiagents4pharma/talk2aiagents4pharma/**' |
|
|
44 |
talk2knowledgegraphs: |
|
|
45 |
- 'aiagents4pharma/talk2knowledgegraphs/**' |
|
|
46 |
app: |
|
|
47 |
- 'app/**' |
|
|
48 |
|
|
|
49 |
# Generate version for the build |
|
|
50 |
version: |
|
|
51 |
runs-on: ubuntu-latest |
|
|
52 |
outputs: |
|
|
53 |
version: ${{ steps.get_version.outputs.version }} |
|
|
54 |
steps: |
|
|
55 |
- name: Checkout Repository |
|
|
56 |
uses: actions/checkout@v4 |
|
|
57 |
with: |
|
|
58 |
fetch-depth: 0 |
|
|
59 |
|
|
|
60 |
# Get the latest version from git tags |
|
|
61 |
|
|
|
62 |
- name: Get latest version tag |
|
|
63 |
id: get_version |
|
|
64 |
run: | |
|
|
65 |
# Get the latest tag from git |
|
|
66 |
LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.1.0") |
|
|
67 |
|
|
|
68 |
# Always use the latest tag directly (no dev builds) |
|
|
69 |
VERSION=$LATEST_TAG |
|
|
70 |
|
|
|
71 |
echo "Using version: $VERSION" |
|
|
72 |
echo "version=$VERSION" >> $GITHUB_OUTPUT |
|
|
73 |
|
|
|
74 |
# Separate job for talk2aiagents4pharma |
|
|
75 |
build-talk2aiagents4pharma: |
|
|
76 |
needs: [changes, version] |
|
|
77 |
if: ${{ needs.changes.outputs.talk2aiagents4pharma == 'true' || needs.changes.outputs.talk2biomodels == 'true' || needs.changes.outputs.talk2knowledgegraphs == 'true' || needs.changes.outputs.app == 'true' }} |
|
|
78 |
runs-on: ubuntu-latest |
|
|
79 |
steps: |
|
|
80 |
- name: Checkout Repository |
|
|
81 |
uses: actions/checkout@v4 |
|
|
82 |
|
|
|
83 |
- name: Login to Docker Hub |
|
|
84 |
uses: docker/login-action@v3 |
|
|
85 |
with: |
|
|
86 |
username: ${{ vars.DOCKERHUB_USERNAME }} |
|
|
87 |
password: ${{ secrets.DOCKERHUB_TOKEN }} |
|
|
88 |
|
|
|
89 |
- name: Build and Push Docker Image |
|
|
90 |
uses: docker/build-push-action@v6 |
|
|
91 |
with: |
|
|
92 |
file: aiagents4pharma/talk2aiagents4pharma/Dockerfile |
|
|
93 |
push: true |
|
|
94 |
tags: | |
|
|
95 |
virtualpatientengine/talk2aiagents4pharma:${{ needs.version.outputs.version }} |
|
|
96 |
virtualpatientengine/talk2aiagents4pharma:latest |
|
|
97 |
|
|
|
98 |
# Separate job for talk2biomodels |
|
|
99 |
build-talk2biomodels: |
|
|
100 |
needs: [changes, version] |
|
|
101 |
if: ${{ needs.changes.outputs.talk2biomodels == 'true' || needs.changes.outputs.app == 'true' }} |
|
|
102 |
runs-on: ubuntu-latest |
|
|
103 |
steps: |
|
|
104 |
- name: Checkout Repository |
|
|
105 |
uses: actions/checkout@v4 |
|
|
106 |
|
|
|
107 |
- name: Login to Docker Hub |
|
|
108 |
uses: docker/login-action@v3 |
|
|
109 |
with: |
|
|
110 |
username: ${{ vars.DOCKERHUB_USERNAME }} |
|
|
111 |
password: ${{ secrets.DOCKERHUB_TOKEN }} |
|
|
112 |
|
|
|
113 |
- name: Build and Push Docker Image |
|
|
114 |
uses: docker/build-push-action@v6 |
|
|
115 |
with: |
|
|
116 |
file: aiagents4pharma/talk2biomodels/Dockerfile |
|
|
117 |
push: true |
|
|
118 |
tags: | |
|
|
119 |
virtualpatientengine/talk2biomodels:${{ needs.version.outputs.version }} |
|
|
120 |
virtualpatientengine/talk2biomodels:latest |
|
|
121 |
|
|
|
122 |
# Separate job for talk2scholars |
|
|
123 |
build-talk2scholars: |
|
|
124 |
needs: [changes, version] |
|
|
125 |
if: ${{ needs.changes.outputs.talk2scholars == 'true' || needs.changes.outputs.app == 'true' }} |
|
|
126 |
runs-on: ubuntu-latest |
|
|
127 |
steps: |
|
|
128 |
- name: Checkout Repository |
|
|
129 |
uses: actions/checkout@v4 |
|
|
130 |
|
|
|
131 |
- name: Login to Docker Hub |
|
|
132 |
uses: docker/login-action@v3 |
|
|
133 |
with: |
|
|
134 |
username: ${{ vars.DOCKERHUB_USERNAME }} |
|
|
135 |
password: ${{ secrets.DOCKERHUB_TOKEN }} |
|
|
136 |
|
|
|
137 |
- name: Build and Push Docker Image |
|
|
138 |
uses: docker/build-push-action@v6 |
|
|
139 |
with: |
|
|
140 |
file: aiagents4pharma/talk2scholars/Dockerfile |
|
|
141 |
push: true |
|
|
142 |
tags: | |
|
|
143 |
virtualpatientengine/talk2scholars:${{ needs.version.outputs.version }} |
|
|
144 |
virtualpatientengine/talk2scholars:latest |
|
|
145 |
|
|
|
146 |
# Separate job for talk2knowledgegraphs |
|
|
147 |
build-talk2knowledgegraphs: |
|
|
148 |
needs: [changes, version] |
|
|
149 |
if: ${{ needs.changes.outputs.talk2knowledgegraphs == 'true' || needs.changes.outputs.app == 'true' }} |
|
|
150 |
runs-on: ubuntu-latest |
|
|
151 |
steps: |
|
|
152 |
- name: Checkout Repository |
|
|
153 |
uses: actions/checkout@v4 |
|
|
154 |
|
|
|
155 |
- name: Login to Docker Hub |
|
|
156 |
uses: docker/login-action@v3 |
|
|
157 |
with: |
|
|
158 |
username: ${{ vars.DOCKERHUB_USERNAME }} |
|
|
159 |
password: ${{ secrets.DOCKERHUB_TOKEN }} |
|
|
160 |
|
|
|
161 |
- name: Build and Push Docker Image |
|
|
162 |
uses: docker/build-push-action@v6 |
|
|
163 |
with: |
|
|
164 |
file: aiagents4pharma/talk2knowledgegraphs/Dockerfile |
|
|
165 |
push: true |
|
|
166 |
tags: | |
|
|
167 |
virtualpatientengine/talk2knowledgegraphs:${{ needs.version.outputs.version }} |
|
|
168 |
virtualpatientengine/talk2knowledgegraphs:latest |