1
0
Fork 0

Add Node.js workflow

Closes #6
upload-progress
Ambrose Chua 2021-05-24 01:12:47 +08:00
parent 4889284016
commit b593556a9a
3 changed files with 30 additions and 8 deletions

View File

@ -1,4 +1,4 @@
name: Go
name: Node.js and Go
on:
push:
@ -13,6 +13,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: 16
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
@ -29,6 +34,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: 16
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
@ -45,6 +55,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: 16
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
@ -74,6 +89,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: 16
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:

View File

@ -1,18 +1,20 @@
FROM node:16-alpine3.13 as build-web
ARG NODE_ENV=production
WORKDIR /src
COPY . .
RUN cd web && npm install
ARG NODE_ENV=production
RUN cd web && npm run build
FROM golang:1.16-alpine3.13 as build
ARG CGO_ENABLED=0
RUN apk add \
make
WORKDIR /src
COPY --from=build-web . .
ARG CGO_ENABLED=0
RUN make TAGS=production
FROM scratch

View File

@ -3,7 +3,7 @@ NPM = npm
.PHONY: all
all: web build
all: build
.PHONY: clean
clean:
@ -12,11 +12,11 @@ clean:
.PHONY: build
build: upl
upl: *.go web/*.tmpl
upl: *.go web/*.tmpl web
$(GO) build -ldflags="-s -w" -tags "$(TAGS)" -v -o upl
.PHONY: test
test:
test: web
$(GO) test -cover -bench=. -v ./...