mirror of
https://github.com/certimate-go/certimate.git
synced 2026-09-24 23:10:13 +08:00
build: prebuild webui in docker
This commit is contained in:
@@ -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 }}
|
||||
|
||||
@@ -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: |
|
||||
|
||||
Reference in New Issue
Block a user