[3af7d7]: / .github / workflows / ci.yml

Download this file

169 lines (148 with data), 5.5 kB

  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
name: Docker Build and Push
on:
# Trigger after RELEASE workflow completes
workflow_run:
workflows: ["RELEASE"]
types:
- completed
branches:
- main
# Keep existing triggers for flexibility
# push:
# branches:
# - main
# workflow_dispatch:
jobs:
# Detect which modules have changed
changes:
runs-on: ubuntu-latest
outputs:
talk2biomodels: ${{ steps.filter.outputs.talk2biomodels }}
talk2scholars: ${{ steps.filter.outputs.talk2scholars }}
talk2aiagents4pharma: ${{ steps.filter.outputs.talk2aiagents4pharma }}
talk2knowledgegraphs: ${{ steps.filter.outputs.talk2knowledgegraphs }}
app: ${{ steps.filter.outputs.app }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check for changes
uses: dorny/paths-filter@v2
id: filter
with:
filters: |
talk2biomodels:
- 'aiagents4pharma/talk2biomodels/**'
talk2scholars:
- 'aiagents4pharma/talk2scholars/**'
talk2aiagents4pharma:
- 'aiagents4pharma/talk2aiagents4pharma/**'
talk2knowledgegraphs:
- 'aiagents4pharma/talk2knowledgegraphs/**'
app:
- 'app/**'
# Generate version for the build
version:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.get_version.outputs.version }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
# Get the latest version from git tags
- name: Get latest version tag
id: get_version
run: |
# Get the latest tag from git
LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.1.0")
# Always use the latest tag directly (no dev builds)
VERSION=$LATEST_TAG
echo "Using version: $VERSION"
echo "version=$VERSION" >> $GITHUB_OUTPUT
# Separate job for talk2aiagents4pharma
build-talk2aiagents4pharma:
needs: [changes, version]
if: ${{ needs.changes.outputs.talk2aiagents4pharma == 'true' || needs.changes.outputs.talk2biomodels == 'true' || needs.changes.outputs.talk2knowledgegraphs == 'true' || needs.changes.outputs.app == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and Push Docker Image
uses: docker/build-push-action@v6
with:
file: aiagents4pharma/talk2aiagents4pharma/Dockerfile
push: true
tags: |
virtualpatientengine/talk2aiagents4pharma:${{ needs.version.outputs.version }}
virtualpatientengine/talk2aiagents4pharma:latest
# Separate job for talk2biomodels
build-talk2biomodels:
needs: [changes, version]
if: ${{ needs.changes.outputs.talk2biomodels == 'true' || needs.changes.outputs.app == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and Push Docker Image
uses: docker/build-push-action@v6
with:
file: aiagents4pharma/talk2biomodels/Dockerfile
push: true
tags: |
virtualpatientengine/talk2biomodels:${{ needs.version.outputs.version }}
virtualpatientengine/talk2biomodels:latest
# Separate job for talk2scholars
build-talk2scholars:
needs: [changes, version]
if: ${{ needs.changes.outputs.talk2scholars == 'true' || needs.changes.outputs.app == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and Push Docker Image
uses: docker/build-push-action@v6
with:
file: aiagents4pharma/talk2scholars/Dockerfile
push: true
tags: |
virtualpatientengine/talk2scholars:${{ needs.version.outputs.version }}
virtualpatientengine/talk2scholars:latest
# Separate job for talk2knowledgegraphs
build-talk2knowledgegraphs:
needs: [changes, version]
if: ${{ needs.changes.outputs.talk2knowledgegraphs == 'true' || needs.changes.outputs.app == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and Push Docker Image
uses: docker/build-push-action@v6
with:
file: aiagents4pharma/talk2knowledgegraphs/Dockerfile
push: true
tags: |
virtualpatientengine/talk2knowledgegraphs:${{ needs.version.outputs.version }}
virtualpatientengine/talk2knowledgegraphs:latest