@@ -9,7 +9,6 @@ RUN apk add libcurl --no-cache && \
99 /root/.dotnet/tools/minver > .version
1010
1111FROM node:10.12.0-alpine AS build
12- ARG MYGET_API_KEY
1312
1413WORKDIR /app
1514
@@ -21,25 +20,29 @@ COPY . .
2120
2221COPY --from=version /src/.version ./
2322
24- RUN REACT_APP_CLIENT_VERSION=$(cat .version) yarn build && \
23+ RUN REACT_APP_CLIENT_VERSION=$(cat .version) \
2524 yarn build:dist && \
26- yarn cache clean
25+ yarn cache clean && \
26+ cp .version ./dist
2727
28- RUN echo "https://www.myget.org/F/sqlstreamstore/npm/:_authToken=${MYGET_API_KEY}" > .npmrc && \
29- echo "@sqlstreamstore:registry=https://www.myget.org/F/sqlstreamstore/npm/" >> .npmrc
28+ FROM build AS publish
29+ ARG MYGET_API_KEY
3030
31- RUN test -z "$MYGET_API_KEY" || \
32- yarn publish --new-version $(cat .version) --no-git-tag-version && \
33- echo "No API key found, skipping publishing..."
31+ RUN \
32+ if [ -n "$MYGET_API_KEY" ] ;\
33+ then echo "https://www.myget.org/F/sqlstreamstore/npm/:_authToken=${MYGET_API_KEY}" > .npmrc && \
34+ echo "@sqlstreamstore:registry=https://www.myget.org/F/sqlstreamstore/npm/" >> .npmrc && \
35+ yarn publish --new-version $(cat .version) --no-git-tag-version ;\
36+ else echo "No API key found, skipping publishing..." ;\
37+ fi
3438
3539FROM nginx:1.15.5-alpine AS runtime
3640
37- COPY ./nginx/nginx.conf / etc/nginx/nginx.conf
41+ WORKDIR / etc/nginx
3842
39- COPY ./nginx/mime.types /etc/nginx/mime.types
43+ COPY ./nginx/ ./
4044
41- COPY --from=build /app/build/ /var/www/
42- COPY --from=version /src/.version /var/www
45+ COPY --from=publish /app/dist/ /var/www/
4346
4447EXPOSE 80
4548
0 commit comments