Build the React frontend

Signed-off-by: Martyn Ranyard <m@rtyn.berlin>
This commit is contained in:
Martyn 2020-08-01 11:38:05 +02:00
parent 8de2c0bd74
commit 4c27138497
4 changed files with 17 additions and 1 deletions

View File

@ -10,6 +10,11 @@ test:
build:
go build ${LDFLAGS}
build-frontend:
cd build/react-frontend && npm run build
rm -rf web/react-frontend ; mkdir -p web/react-frontend
cp -r build/react-frontend/build/* web/react-frontend/
deps:
go get

View File

@ -59,6 +59,11 @@ steps:
- make test
- make
- name: build-frontend
image: node
commands:
- make frontend
trigger:
ref:
- refs/heads/main

View File

@ -5,9 +5,14 @@ COPY internal/ /go/src/git.martyn.berlin/martyn/twitchsingstools/internal/
COPY Makefile /go/src/git.martyn.berlin/martyn/twitchsingstools/
RUN cd /go/src/git.martyn.berlin/martyn/twitchsingstools/; make deps ; make static
FROM scratch
FROM library/node:14.7.0-stretch AS frontend
COPY build/react-frontend /frontend
RUN cd /frontend; npm run build
FROM debian
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /go/src/git.martyn.berlin/martyn/twitchsingstools /app/
COPY web/ /app/web/
COPY --from=frontend /frontend/build /app/web/react-frontend
WORKDIR /app
CMD ["/app/twitchsingstools"]

1
build/react-frontend Submodule

@ -0,0 +1 @@
Subproject commit 5d2ed3c5be7d050e48b6bedbd2591543d732bf52