From 8e3fc703d951f4e5e695e6c5b10ce9342ba5b24e Mon Sep 17 00:00:00 2001 From: wendazhi Date: Tue, 10 Feb 2026 17:54:32 +0800 Subject: [PATCH] init221 --- .gitea/workflows/run.yml | 44 +++++++++++++++++++++++++--------------- 1 file changed, 28 insertions(+), 16 deletions(-) diff --git a/.gitea/workflows/run.yml b/.gitea/workflows/run.yml index 7138160..32cec23 100644 --- a/.gitea/workflows/run.yml +++ b/.gitea/workflows/run.yml @@ -9,24 +9,36 @@ jobs: build: runs-on: host steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: '20' - cache: 'yarn' - - - name: Install dependencies + - name: Ensure Node.js (install if missing) run: | - corepack enable - yarn install --frozen-lockfile + if ! command -v node >/dev/null 2>&1; then + echo "Node.js not found, installing..." + curl -fsSL https://deb.nodesource.com/setup_20.x | bash - + apt-get install -y nodejs + else + echo "Node.js already installed: $(node -v)" + fi + + - name: Clone repository + run: | + set -e + REPO_URL="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + echo "Cloning repo from: ${REPO_URL}" + rm -rf repo + git clone "${REPO_URL}" repo - name: Build project - run: yarn build - - - name: copy dist /data/wwwroot/weizhuozhongzhi-ai run: | + set -e + cd repo + corepack enable + yarn install --frozen-lockfile + yarn build + + - name: Copy dist to /data/wwwroot/weizhuozhongzhi-ai + run: | + set -e + cd repo mkdir -p /data/wwwroot/weizhuozhongzhi-ai - cp -r ./dist/* /data/wwwroot/weizhuozhongzhi-ai/ \ No newline at end of file + rm -rf /data/wwwroot/weizhuozhongzhi-ai/* + cp -r dist/* /data/wwwroot/weizhuozhongzhi-ai/ \ No newline at end of file