|
1 | | -name: Build and deploy |
| 1 | +name: Build, scan images and deploy |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | push: |
|
8 | 8 | types: |
9 | 9 | - published |
10 | 10 | - edited |
11 | | - workflow_dispatch: # Add this to allow manual triggering |
12 | | - pull_request: |
13 | | - branches: |
14 | | - - main |
| 11 | + workflow_dispatch: |
15 | 12 |
|
16 | 13 | jobs: |
17 | | - build-api: |
| 14 | + build-opengatellm-api: |
18 | 15 | name: Build and push OpenGateLLM API image |
19 | 16 | runs-on: ubuntu-latest |
20 | 17 | env: |
@@ -126,12 +123,12 @@ jobs: |
126 | 123 | matrix: |
127 | 124 | environment: [dev, staging, prod] |
128 | 125 | include: |
129 | | - - environment: prod |
130 | | - url: https://albert.playground.etalab.gouv.fr |
131 | | - - environment: staging |
132 | | - url: https://albert.playground.staging.etalab.gouv.fr |
133 | 126 | - environment: dev |
134 | 127 | url: https://albert.playground.dev.etalab.gouv.fr |
| 128 | + - environment: staging |
| 129 | + url: https://albert.playground.staging.etalab.gouv.fr |
| 130 | + - environment: prod |
| 131 | + url: https://albert.playground.etalab.gouv.fr |
135 | 132 | steps: |
136 | 133 | - name: Checkout repository |
137 | 134 | uses: actions/checkout@v4 |
@@ -164,29 +161,37 @@ jobs: |
164 | 161 |
|
165 | 162 | trivy-scan-api: |
166 | 163 | name: Trivy scan — API |
167 | | - needs: build-api |
| 164 | + needs: build-opengatellm-api |
168 | 165 | uses: ./.github/workflows/trivy-scan.yml |
169 | 166 | with: |
170 | 167 | image-name: ghcr.io/etalab-ia/opengatellm/api |
171 | 168 | image-tag: ${{ github.event_name == 'release' && github.event.release.tag_name || 'latest' }} |
172 | | - category-prefix: trivy-api |
| 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' }} |
173 | 177 |
|
174 | 178 | deploy-dev: |
175 | 179 | if: github.event_name == 'push' # Only deploy on push to main |
176 | 180 | name: Deploy from ${{ github.ref_name }}/${{ github.sha }} |
177 | 181 | runs-on: ubuntu-latest |
178 | 182 | needs: |
179 | | - - build-api |
| 183 | + - build-opengatellm-api |
180 | 184 | - build-opengatellm-playground |
181 | 185 | - build-albert-playground |
182 | 186 | - trivy-scan-api |
| 187 | + - trivy-scan-playground |
183 | 188 | steps: |
184 | 189 | - name: Trigger dev deployment |
185 | 190 | run: | |
186 | 191 | RESPONSE="$(curl --request POST \ |
187 | 192 | --form token=${{ secrets.GITLAB_CI_TOKEN }} \ |
188 | 193 | --form ref=main \ |
189 | | - --form 'variables[pipeline_name]=${{ github.event.repository.name }} - ${{ needs.build-api.outputs.commit_title }}' \ |
| 194 | + --form 'variables[pipeline_name]=${{ github.event.repository.name }} - ${{ needs.build-opengatellm-api.outputs.commit_title }}' \ |
190 | 195 | --form 'variables[docker_image_tag]=latest' \ |
191 | 196 | --form 'variables[application_to_deploy]=albert-api' \ |
192 | 197 | --form 'variables[deployment_environment]=dev' \ |
|
0 commit comments