diff --git a/.gitea/workflows/gobuild.yaml b/.gitea/workflows/gobuild.yaml index 27692af..8ee237d 100644 --- a/.gitea/workflows/gobuild.yaml +++ b/.gitea/workflows/gobuild.yaml @@ -28,6 +28,21 @@ jobs: - name: Checkout code uses: actions/checkout@v5 + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 26 + cache: 'npm' + cache-dependency-path: ./frontend/package-lock.json + + - name: Install Dependencies + working-directory: ./frontend + run: npm ci + + - name: Run Vite Build + working-directory: ./frontend + run: npm run build + - name: Set up Go uses: actions/setup-go@v6 with: diff --git a/Dockerfile b/Dockerfile index a47d6a7..cb02c2e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,18 @@ +# Frontend build stage +FROM node:22-alpine AS frontend-builder +WORKDIR /app +COPY frontend/package*.json ./ +RUN npm ci +COPY frontend/ . +RUN npm run build + # Build stage FROM golang:latest AS builder WORKDIR /app COPY go.mod go.sum ./ RUN go mod download COPY . . +COPY --from=frontend-builder /app/dist ./frontend/dist RUN CGO_ENABLED=0 GOOS=linux go build -v -o outfit-voting-abi26 ./cmd/ # Final stage