From 04c3c4d12a56258bd3d40d433408cfe7030573a0 Mon Sep 17 00:00:00 2001 From: Jason Kulatunga Date: Thu, 26 Jan 2023 02:45:33 -0800 Subject: [PATCH] yarn cache (node_modules) directory should already exist, so yarn install should be a noop. --- .github/workflows/build.yaml | 19 +++++++++---------- Dockerfile | 12 +++--------- 2 files changed, 12 insertions(+), 19 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 4cba6fa46..203c133ca 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -24,16 +24,15 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v2 -# - name: "Populate frontend version information" -# run: "cd webapp/frontend && ./git.version.sh" -# - name: "Generate frontend & version information" -# uses: addnab/docker-run-action@v3 -# with: -# image: node:lts -# options: -v ${{ github.workspace }}:/work -# run: | -# cd /work -# make binary-frontend && echo "print contents of /work/dist" && ls -alt /work/dist + - name: Set Node.js 18.x + uses: actions/setup-node@v3 + with: + node-version: 18.x + - name: Create Yarn Cache + run: | + cd frontend + yarn install --frozen-lockfile + - name: Set up QEMU uses: docker/setup-qemu-action@v2 with: diff --git a/Dockerfile b/Dockerfile index 275494570..892887f3b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,16 +4,10 @@ FROM node:18 as frontend-build ARG FASTEN_ENV=sandbox WORKDIR /usr/src/fastenhealth/frontend -COPY frontend/package.json frontend/yarn.lock ./ - -RUN yarn --version && \ - yarn config delete proxy && \ - yarn config delete https-proxy && \ - yarn config set registry 'http://registry.npmjs.org' && \ - yarn config list && \ - yarn install COPY frontend/ ./ -RUN yarn run build -- --configuration ${FASTEN_ENV} --output-path=../dist + +RUN yarn install --frozen-lockfile && \ + yarn run build -- --configuration ${FASTEN_ENV} --output-path=../dist ######################################################################################################### # Backend Build