File tree Expand file tree Collapse file tree 3 files changed +22
-3
lines changed
Expand file tree Collapse file tree 3 files changed +22
-3
lines changed Original file line number Diff line number Diff line change 3333 build-and-deploy :
3434 name : Build and Deploy
3535 needs : [upload-package-lock-json, make-react-secret-available]
36- uses : clearlydefined/operations/.github/workflows/app-build-and-deploy.yml@v2.0.0
36+ uses : clearlydefined/operations/.github/workflows/app-build-and-deploy.yml@v3.1.2
3737 secrets :
3838 AZURE_CREDENTIALS : ${{ secrets.AZURE_CREDENTIALS }}
3939 AZURE_WEBAPP_PUBLISH_PROFILE : ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE_DEV }}
Original file line number Diff line number Diff line change 33FROM node:14-alpine as builder
44COPY . /opt/website
55WORKDIR /opt/website
6+
7+ # Set environment variables from build arguments
8+ ARG APP_VERSION="UNKNOWN"
9+ ENV APP_VERSION=$APP_VERSION
10+ ARG BUILD_SHA="UNKNOWN"
11+ ENV BUILD_SHA=$BUILD_SHA
12+
613ARG REACT_APP_SERVER=http://localhost:4000
714ARG REACT_APP_GA_TRACKINGID
815RUN apk add --no-cache git
916RUN npm install -g npm@9
1017RUN npm install
1118RUN npm run build
1219
13- FROM nginx:alpine
14- ADD nginx.conf /etc/nginx/conf.d/default.conf
20+ FROM nginx:1.19.6-alpine
21+
22+ ARG APP_VERSION="UNKNOWN"
23+ ENV APP_VERSION=$APP_VERSION
24+ ARG BUILD_SHA="UNKNOWN"
25+ ENV BUILD_SHA=$BUILD_SHA
26+
27+ RUN mkdir /etc/nginx/templates
28+ COPY default.conf.template /etc/nginx/templates
1529COPY --from=builder /opt/website/build /usr/share/nginx/html
1630EXPOSE 80
Original file line number Diff line number Diff line change @@ -12,6 +12,11 @@ server {
1212 etag off;
1313 }
1414
15+ location /health {
16+ add_header 'Content-Type' 'application/json';
17+ return 200 '{"status":"OK", "version": "${APP_VERSION}", "sha": "${BUILD_SHA}"}';
18+ }
19+
1520 # redirect server error pages to the static page /50x.html
1621 #
1722 error_page 500 502 503 504 /50x.html;
You can’t perform that action at this time.
0 commit comments