Unverified Commit fdc0553c authored by Johnny's avatar Johnny Committed by GitHub

chore: move frontend build to action

parent bb892be5
...@@ -57,6 +57,21 @@ jobs: ...@@ -57,6 +57,21 @@ jobs:
username: ${{ github.actor }} username: ${{ github.actor }}
password: ${{ github.token }} password: ${{ github.token }}
# Frontend build.
- uses: pnpm/action-setup@v4.1.0
with:
version: 10
- uses: actions/setup-node@v4
with:
node-version: "22"
cache: pnpm
cache-dependency-path: "web/pnpm-lock.yaml"
- run: pnpm install
working-directory: web
- name: Run frontend build
run: pnpm release
working-directory: web
- name: Build and Push - name: Build and Push
id: docker_build id: docker_build
uses: docker/build-push-action@v6 uses: docker/build-push-action@v6
......
# Build frontend dist.
FROM node:20-alpine AS frontend
WORKDIR /frontend-build
COPY . .
WORKDIR /frontend-build/web
RUN npm install -g pnpm
RUN pnpm i --frozen-lockfile
RUN pnpm build
# Build backend exec file.
FROM golang:1.24-alpine AS backend FROM golang:1.24-alpine AS backend
WORKDIR /backend-build WORKDIR /backend-build
COPY . . COPY . .
COPY --from=frontend /frontend-build/web/dist /backend-build/server/router/frontend/dist # Please build frontend first, so that the static files are available.
# Refer to `pnpm release` in package.json for the build command.
RUN go build -o memos ./bin/memos/main.go RUN go build -o memos ./bin/memos/main.go
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment