From 459fa490ad4a45199f929fc651a9692ebf0e2c62 Mon Sep 17 00:00:00 2001 From: Darren P <36205316+darpham@users.noreply.github.com> Date: Fri, 16 Feb 2024 15:04:44 -0800 Subject: [PATCH] Github Actions; fix frontend build (#361) Co-authored-by: Darren --- .github/workflows/ci.yaml | 2 +- docker-bake.hcl | 4 ++-- docker/frontend/Dockerfile | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index f9fc2966..50beafae 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -21,7 +21,7 @@ jobs: contents: read strategy: matrix: - image: [frontend, backend, graphql] + image: [build, backend, graphql] steps: - uses: actions/checkout@v4 with: diff --git a/docker-bake.hcl b/docker-bake.hcl index 580aa128..def173dc 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -79,7 +79,7 @@ variable "REACT_APP_JWT_ISSUER" { default = "default-jwt" } target "build" { dockerfile = "docker/frontend/Dockerfile" context = "./" - target = "prod" + target = "nginx-build" args = { PUBLIC_URL = "${PUBLIC_URL}" REACT_APP_GRAPHQL_URL = "${REACT_APP_GRAPHQL_URL}" @@ -94,7 +94,7 @@ target "build" { target "frontend" { dockerfile = "docker/frontend/Dockerfile" context = "./" - target = "dev" + target = "local" inherits = ["_common"] tags = dockerTag("happeningatm", "${DOCKER_TAG}", "frontend") cache-from = [dockerS3Cache("${CACHE_ID}-frontend")] diff --git a/docker/frontend/Dockerfile b/docker/frontend/Dockerfile index 4e460d46..3f1400c5 100644 --- a/docker/frontend/Dockerfile +++ b/docker/frontend/Dockerfile @@ -4,7 +4,7 @@ WORKDIR /usr/src/app COPY ./frontend/package*.json . RUN npm install --from-lockfile -FROM docker.io/library/node:14.21.3 as dev +FROM docker.io/library/node:14.21.3 as local LABEL org.opensourcesanjose.app="happening-atm" WORKDIR /usr/src/app @@ -14,7 +14,7 @@ COPY --from=node_modules_cache /usr/src/app/node_modules /usr/src/app/node_modul EXPOSE 3000/tcp CMD [ "npm", "run", "start"] -FROM dev as build +FROM local as build LABEL org.opensourcesanjose.app="happening-atm" ARG PUBLIC_URL ARG REACT_APP_GRAPHQL_URL @@ -22,7 +22,7 @@ ARG REACT_APP_JWT_ISSUER ARG REACT_APP_RECAPTCHAS_SITE_KEY RUN npm run build -FROM nginx as prod +FROM nginx as nginx-build LABEL org.opensourcesanjose.app="happening-atm" COPY docker/frontend/nginx.conf /etc/nginx/nginx.conf COPY --from=build /usr/src/app/build /usr/share/nginx/html