diff --git a/.gitattributes b/.gitattributes index acb61f222d..a677605459 100644 --- a/.gitattributes +++ b/.gitattributes @@ -6,6 +6,7 @@ *.less eol=lf *.styl eol=lf *.js eol=lf +*.cjs eol=lf *.ts eol=lf *.jsx eol=lf *.tsx eol=lf diff --git a/.github/workflows/docker-build.yaml b/.github/workflows/docker-build.yaml index b23b068b28..9968bab16f 100644 --- a/.github/workflows/docker-build.yaml +++ b/.github/workflows/docker-build.yaml @@ -83,6 +83,17 @@ jobs: tags: type=sha - name: Build and push Docker image + if: github.event_name == 'workflow_dispatch' + uses: docker/build-push-action@v4 + with: + context: . + push: ${{ github.event_name == 'push' }} + provenance: false + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + + - name: Build and push Docker image + if: github.event_name != 'workflow_dispatch' uses: docker/build-push-action@v4 with: context: . @@ -92,10 +103,6 @@ jobs: labels: ${{ steps.meta.outputs.labels }} cache-from: type=local,src=/tmp/.buildx-cache cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max - build-args: | - TECHDOCS_BUILDER_TYPE=external - TECHDOCS_GENERATOR_TYPE=local - TECHDOCS_PUBLISHER_TYPE=awsS3 - # Temp fix # https://github.com/docker/build-push-action/issues/252 diff --git a/Dockerfile b/Dockerfile index 666b95e79f..57a7a74d49 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,7 +14,9 @@ COPY .yarnrc.yml ./ RUN find packages -mindepth 2 -maxdepth 2 \! -name "package.json" -exec rm -rf {} \+ ENV IS_CONTAINER="TRUE" -RUN $YARN install --frozen-lockfile --network-timeout 600000 +RUN $YARN add -D -W --arch=x64 --platform=linux turbo +RUN $YARN add -D -W --arch=x64 --platform=linux @esbuild/linux-x64 +RUN $YARN install --frozen-lockfile --network-timeout 600000 --ignore-optional # Stage 2 - Build packages FROM registry.access.redhat.com/ubi9/nodejs-18-minimal:latest AS build @@ -59,7 +61,7 @@ RUN tar xzf skeleton.tar.gz && rm skeleton.tar.gz # Install production dependencies ENV IS_CONTAINER="TRUE" -RUN $YARN install --frozen-lockfile --production --network-timeout 600000 && $YARN cache clean +RUN $YARN install --frozen-lockfile --production --network-timeout 600000 --ignore-optional && $YARN cache clean # Copy the built packages from the build stage COPY --from=build /opt/app-root/src/packages/backend/dist/bundle.tar.gz .