Skip to content

Commit

Permalink
Github Actions; fix frontend build (#361)
Browse files Browse the repository at this point in the history
Co-authored-by: Darren <darpham@users.noreply.github.com>
  • Loading branch information
darpham and darpham authored Feb 16, 2024
1 parent 8192cea commit 459fa49
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
contents: read
strategy:
matrix:
image: [frontend, backend, graphql]
image: [build, backend, graphql]
steps:
- uses: actions/checkout@v4
with:
Expand Down
4 changes: 2 additions & 2 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand All @@ -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")]
Expand Down
6 changes: 3 additions & 3 deletions docker/frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -14,15 +14,15 @@ 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
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
Expand Down

0 comments on commit 459fa49

Please sign in to comment.