build: prebuild webui in docker

This commit is contained in:
Fu Diwei
2025-09-06 01:11:21 +08:00
parent 2b77600a28
commit e2972045fd
4 changed files with 52 additions and 4 deletions
+33 -1
View File
@@ -13,6 +13,32 @@ on:
default: "next"
jobs:
prepare-ui:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 22.19.0
- name: Build UI
run: |
echo "VITE_APP_VERSION=${GITHUB_REF#refs/tags/}" > ./ui/.env
npm --prefix=./ui ci
npm --prefix=./ui run build
- name: Upload UI build artifacts
uses: actions/upload-artifact@v4
with:
name: ui-build
path: ./ui/dist
retention-days: 1
build-and-push:
runs-on: ubuntu-latest
@@ -55,11 +81,17 @@ jobs:
run: |
echo "VITE_APP_VERSION=${GITHUB_REF#refs/tags/}" > ./ui/.env
- name: Download UI build artifacts
uses: actions/download-artifact@v4
with:
name: ui-build
path: ./ui/dist
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
file: ./Dockerfile.gh
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
+1 -1
View File
@@ -17,7 +17,7 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20.11.0
node-version: 22.19.0
- name: Build UI
run: |