CI: add build step to deploy workflow

- Clone from local Gitea instead of actions/checkout
- Build with legacy builder (DOCKER_BUILDKIT=0) for Docker mirror support
- Use npm China mirror (registry.npmmirror.com) in Dockerfile
- Combined npm install+build in single RUN step
- Removed stale proxy env vars
This commit is contained in:
Gan, Jimmy
2026-02-25 21:14:00 +08:00
parent dcc078addd
commit a968364f18
2 changed files with 7 additions and 7 deletions
+6 -5
View File
@@ -11,11 +11,12 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: container:
volumes: volumes:
- /var/packages/ContainerManager/target/usr/bin/docker:/usr/bin/docker
- /volume1/docker/nas-dashboard:/nas-dashboard - /volume1/docker/nas-dashboard:/nas-dashboard
env:
HTTP_PROXY: ${{ secrets.PROXY_URL }}
HTTPS_PROXY: ${{ secrets.PROXY_URL }}
steps: steps:
- name: Checkout
run: git clone --depth 1 http://gitea:3000/jimmy/nas-tools.git .
- name: Build
run: DOCKER_BUILDKIT=0 docker build -t nas-dashboard:latest dashboard/
- name: Deploy - name: Deploy
run: | run: docker compose -f /nas-dashboard/docker-compose.yml up -d --pull never
docker compose -f /nas-dashboard/docker-compose.yml up -d --pull never
+1 -2
View File
@@ -2,9 +2,8 @@
FROM node:20-alpine AS frontend FROM node:20-alpine AS frontend
WORKDIR /build WORKDIR /build
COPY frontend/package.json frontend/package-lock.json* ./ COPY frontend/package.json frontend/package-lock.json* ./
RUN npm install
COPY frontend/ ./ COPY frontend/ ./
RUN npm run build RUN npm install --registry=https://registry.npmmirror.com && npm run build
# Stage 2: Python runtime # Stage 2: Python runtime
FROM python:3.12-slim FROM python:3.12-slim