1- name : Build and deploy
1+ name : Build, scan images and deploy
22
33on :
44 push :
55 branches :
66 - main
77 release :
8- types :
8+ types :
99 - published
1010 - edited
11- workflow_dispatch : # Add this to allow manual triggering
11+ workflow_dispatch :
1212
1313jobs :
14- build-api :
14+ build-opengatellm- api :
1515 name : Build and push OpenGateLLM API image
1616 runs-on : ubuntu-latest
1717 env :
@@ -112,7 +112,7 @@ jobs:
112112 tags : ${{ env.GITHUB_PLAYGROUND_IMAGE_NAME }}:${{ env.IMAGE_TAG }}
113113 cache-from : type=registry,ref=${{ env.GITHUB_PLAYGROUND_IMAGE_NAME }}:cache
114114 cache-to : type=registry,ref=${{ env.GITHUB_PLAYGROUND_IMAGE_NAME }}:cache,mode=max
115-
115+
116116 build-albert-playground :
117117 name : Build and push Albert playground image
118118 runs-on : ubuntu-latest
@@ -123,13 +123,12 @@ jobs:
123123 matrix :
124124 environment : [dev, staging, prod]
125125 include :
126- - environment : prod
127- url : https://albert.playground.etalab.gouv.fr
128- - environment : staging
129- url : https://albert.playground.staging.etalab.gouv.fr
130126 - environment : dev
131127 url : https://albert.playground.dev.etalab.gouv.fr
132-
128+ - environment : staging
129+ url : https://albert.playground.staging.etalab.gouv.fr
130+ - environment : prod
131+ url : https://albert.playground.etalab.gouv.fr
133132 steps :
134133 - name : Checkout repository
135134 uses : actions/checkout@v4
@@ -160,18 +159,47 @@ jobs:
160159 tags : ${{ env.GITLAB_PLAYGROUND_IMAGE_NAME }}/${{ matrix.environment }}:${{ env.IMAGE_TAG }}
161160 cache-from : type=registry,ref=${{ env.GITHUB_PLAYGROUND_IMAGE_NAME }}:cache
162161
162+ trivy-scan-api :
163+ name : Trivy scan — API
164+ needs : build-opengatellm-api
165+ uses : ./.github/workflows/trivy-scan.yml
166+ with :
167+ image-name : ghcr.io/etalab-ia/opengatellm/api
168+ image-tag : ${{ github.event_name == 'release' && github.event.release.tag_name || 'latest' }}
169+
170+ trivy-scan-playground :
171+ name : Trivy scan — Playground
172+ needs : build-opengatellm-playground
173+ uses : ./.github/workflows/trivy-scan.yml
174+ with :
175+ image-name : ghcr.io/etalab-ia/opengatellm/playground
176+ image-tag : ${{ github.event_name == 'release' && github.event.release.tag_name || 'latest' }}
177+
178+ trivy-scan-worker :
179+ name : Trivy scan — Worker
180+ needs : build-opengatellm-worker
181+ uses : ./.github/workflows/trivy-scan.yml
182+ with :
183+ image-name : ghcr.io/etalab-ia/opengatellm/worker
184+ image-tag : ${{ github.event_name == 'release' && github.event.release.tag_name || 'latest' }}
185+
163186 deploy-dev :
164187 if : github.event_name == 'push' # Only deploy on push to main
165188 name : Deploy from ${{ github.ref_name }}/${{ github.sha }}
166189 runs-on : ubuntu-latest
167- needs : [build-api, build-opengatellm-playground, build-albert-playground]
190+ needs :
191+ - build-opengatellm-api
192+ - trivy-scan-api
193+ - build-opengatellm-playground
194+ - trivy-scan-playground
195+ - build-albert-playground
168196 steps :
169197 - name : Trigger dev deployment
170198 run : |
171199 RESPONSE="$(curl --request POST \
172200 --form token=${{ secrets.GITLAB_CI_TOKEN }} \
173201 --form ref=main \
174- --form 'variables[pipeline_name]=${{ github.event.repository.name }} - ${{ needs.build-api.outputs.commit_title }}' \
202+ --form 'variables[pipeline_name]=${{ github.event.repository.name }} - ${{ needs.build-opengatellm- api.outputs.commit_title }}' \
175203 --form 'variables[docker_image_tag]=latest' \
176204 --form 'variables[application_to_deploy]=albert-api' \
177205 --form 'variables[deployment_environment]=dev' \
0 commit comments