Build the React frontend
Signed-off-by: Martyn Ranyard <m@rtyn.berlin>
This commit is contained in:
parent
8de2c0bd74
commit
4c27138497
5
Makefile
5
Makefile
|
@ -10,6 +10,11 @@ test:
|
||||||
build:
|
build:
|
||||||
go build ${LDFLAGS}
|
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:
|
deps:
|
||||||
go get
|
go get
|
||||||
|
|
||||||
|
|
|
@ -59,6 +59,11 @@ steps:
|
||||||
- make test
|
- make test
|
||||||
- make
|
- make
|
||||||
|
|
||||||
|
- name: build-frontend
|
||||||
|
image: node
|
||||||
|
commands:
|
||||||
|
- make frontend
|
||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
ref:
|
ref:
|
||||||
- refs/heads/main
|
- refs/heads/main
|
||||||
|
|
|
@ -5,9 +5,14 @@ COPY internal/ /go/src/git.martyn.berlin/martyn/twitchsingstools/internal/
|
||||||
COPY Makefile /go/src/git.martyn.berlin/martyn/twitchsingstools/
|
COPY Makefile /go/src/git.martyn.berlin/martyn/twitchsingstools/
|
||||||
RUN cd /go/src/git.martyn.berlin/martyn/twitchsingstools/; make deps ; make static
|
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 /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
||||||
COPY --from=builder /go/src/git.martyn.berlin/martyn/twitchsingstools /app/
|
COPY --from=builder /go/src/git.martyn.berlin/martyn/twitchsingstools /app/
|
||||||
COPY web/ /app/web/
|
COPY web/ /app/web/
|
||||||
|
COPY --from=frontend /frontend/build /app/web/react-frontend
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
CMD ["/app/twitchsingstools"]
|
CMD ["/app/twitchsingstools"]
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 5d2ed3c5be7d050e48b6bedbd2591543d732bf52
|
Loading…
Reference in New Issue