From f49e0e1c8d11993d4a4de0f9a4c6539cd74c7dbc Mon Sep 17 00:00:00 2001 From: Matlavv Date: Fri, 15 Nov 2024 10:58:18 +0100 Subject: [PATCH] test the CI - separate each steps for mor visibility on the builds --- .github/workflows/ci.yml | 61 ++++++++++++++++++++++++---------------- src/api/utils/catalog.ts | 2 +- 2 files changed, 38 insertions(+), 25 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dc46890..49f49c4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,10 +8,10 @@ on: env: IMAGE_NAME: amelieloulou/transform-and-deliver-assets CHART_PATH: ./opensource + jobs: - build-and-push-docker: + setup-docker: runs-on: ubuntu-latest - steps: - name: Checkout repository uses: actions/checkout@v3 @@ -27,38 +27,51 @@ jobs: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} + build-and-push-docker-api: + runs-on: ubuntu-latest + needs: setup-docker + steps: + - name: Checkout repository + uses: actions/checkout@v3 + - name: Build and push Docker image API run: | docker buildx build --platform linux/amd64,linux/arm64 --push -t ${{ env.IMAGE_NAME }}:latest ./src/api + build-and-push-docker-job: + runs-on: ubuntu-latest + needs: setup-docker + steps: + - name: Checkout repository + uses: actions/checkout@v3 + - name: Build and push Docker image Job run: | docker buildx build --platform linux/amd64,linux/arm64 --push -t ${{ env.IMAGE_NAME }}:job-latest ./src - publish-helm-chart: - runs-on: ubuntu-latest - needs: build-and-push-docker + setup-helm: + runs-on: ubuntu-latest + needs: build-and-push-docker-job steps: - - name: Checkout repository - uses: actions/checkout@v3 + - name: Checkout repository + uses: actions/checkout@v3 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + - name: Install Helm + uses: azure/setup-helm@v3 + with: + version: v3.11.1 - - name: Log in to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - name: Install Helm - uses: azure/setup-helm@v3 - with: - version: v3.11.1 + push-helm-chart: + runs-on: ubuntu-latest + needs: setup-helm + steps: + - name: Checkout repository + uses: actions/checkout@v3 - - name: Package Helm chart - run: | - helm package opensource + - name: Package Helm chart + run: | + helm package opensource - - name: Push Helm chart to Docker Hub - run: | - helm push $(ls *.tgz) oci://registry-1.docker.io/amelieloulou + - name: Push Helm chart to Docker Hub + run: | + helm push $(ls *.tgz) oci://registry-1.docker.io/amelieloulou diff --git a/src/api/utils/catalog.ts b/src/api/utils/catalog.ts index aba4dc4..e07ea6f 100644 --- a/src/api/utils/catalog.ts +++ b/src/api/utils/catalog.ts @@ -62,7 +62,7 @@ export const formatItemForCatalog = async ( uuid: newUUID, version: 1, namespace, - public_url: `${app.locals.PREFIXED_ASSETS_URL}/${mimetype === 'application/pdf' || mimetype === 'image/svg+xml' ? 'original' : 'full'}${finalPath}`, + public_url: `${process.env.NGINX_INGRESS}${app.locals.PREFIXED_ASSETS_URL}/${mimetype === 'application/pdf' || mimetype === 'image/svg+xml' ? 'original' : 'full'}${finalPath}`, unique_name: finalPath, filename: toWebp && ['image/jpeg', 'image/png'].includes(mimetype) ? resourceName.split('.')[0] + '.webp' : resourceName, original_filename: resourceName,