|
83 | 83 | type=registry,ref=filigran/${{ matrix.image }}:development |
84 | 84 | type=registry,ref=filigran/${{ matrix.image }}:cache-${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }} |
85 | 85 | cache-to: type=registry,ref=filigran/${{ matrix.image }}:cache-${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }},mode=max |
| 86 | + load: true |
| 87 | + |
| 88 | + - name: Extract build files from Docker image |
| 89 | + run: | |
| 90 | + IMAGE_TAG="${{ steps.meta.outputs.tags }}" |
| 91 | + IMAGE_TAG=$(echo "$IMAGE_TAG" | head -n1 | tr -d ' ') |
| 92 | +
|
| 93 | + container_id=$(docker create $IMAGE_TAG) |
| 94 | + mkdir -p ./extracted-build |
| 95 | +
|
| 96 | + case "${{ matrix.image }}" in |
| 97 | + portal-front) |
| 98 | + echo "=== Extraction du build portal-front ===" |
| 99 | + docker cp $container_id:/app/apps/portal-front/.next/standalone ./extracted-build/standalone || echo "Pas de standalone" |
| 100 | + docker cp $container_id:/app/apps/portal-front/.next/static ./extracted-build/static || echo "Pas de static" |
| 101 | + docker cp $container_id:/app/apps/portal-front/public ./extracted-build/public || echo "Pas de public" |
| 102 | + ;; |
| 103 | + portal-api) |
| 104 | + echo "=== Extraction du build portal-api ===" |
| 105 | + # Exemple : NestJS compilé dans dist |
| 106 | + docker cp $container_id:/app ./extracted-build || echo "Pas de dist" |
| 107 | + ;; |
| 108 | + portal-e2e-tests) |
| 109 | + echo "=== Extraction du build portal-e2e-tests ===" |
| 110 | + # Exemple : si tu veux récupérer seeds et migrations déjà copiées |
| 111 | + docker cp $container_id:/app/migrations ./extracted-build/migrations || echo "Pas de migrations" |
| 112 | + docker cp $container_id:/app/seeds ./extracted-build/seeds || echo "Pas de seeds" |
| 113 | + ;; |
| 114 | + *) |
| 115 | + echo "Image non reconnue : ${{ matrix.image }}" |
| 116 | + ;; |
| 117 | + esac |
| 118 | + docker rm $container_id |
| 119 | +
|
| 120 | + echo "=== Fichiers extraits ===" |
| 121 | + ls -la ./extracted-build/ |
| 122 | + - name: Upload artifact |
| 123 | + uses: actions/upload-artifact@v4 |
| 124 | + with: |
| 125 | + name: build-context-${{ matrix.image }} |
| 126 | + path: ./extracted-build/ |
| 127 | + retention-days: 3 |
| 128 | + if-no-files-found: error |
86 | 129 |
|
87 | 130 | run-e2e-tests: |
88 | 131 | needs: build-images-tests |
@@ -236,6 +279,17 @@ jobs: |
236 | 279 | password: ${{ secrets.DOCKERHUB_TOKEN }} |
237 | 280 | - name: Install docker |
238 | 281 | uses: docker/setup-docker-action@v4 |
| 282 | + - name: Download all artifacts |
| 283 | + uses: actions/download-artifact@v5 |
| 284 | + with: |
| 285 | + pattern: build* |
| 286 | + - name: List downloaded artifacts |
| 287 | + run: | |
| 288 | + echo "=== Structure des artifacts téléchargés ===" |
| 289 | + ls -la |
| 290 | + echo "" |
| 291 | + echo "=== Contenu détaillé ===" |
| 292 | + find . -type f -ls |
239 | 293 | - name: Launch docker compose |
240 | 294 | run: | |
241 | 295 | mkdir -p coverage |
|
0 commit comments