From aaf4e498f87d88d20ceba762fb3820b203f3576a Mon Sep 17 00:00:00 2001 From: SpecialX <47072643+wangxiner55@users.noreply.github.com> Date: Mon, 22 Dec 2025 13:38:56 +0800 Subject: [PATCH] chore: remove debug steps and loyment workflow --- .gitea/workflows/ci.yml | 87 +++++++++++++++++++++-------------------- 1 file changed, 45 insertions(+), 42 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 300830b..f3ffd33 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -30,52 +30,55 @@ jobs: - name: Build run: npm run build - - name: 🔍 Debug - List Build Files - run: | - echo "=======================" - echo "1. Root directory files:" - ls -la + # - name: 🔍 Debug - List Build Files + # run: | + # echo "=======================" + # echo "1. Root directory files:" + # ls -la - echo "=======================" - echo "2. Checking .next directory:" - if [ -d ".next" ]; then - ls -la .next - else - echo "❌ Error: .next folder does not exist!" - fi + # echo "=======================" + # echo "2. Checking .next directory:" + # if [ -d ".next" ]; then + # ls -la .next + # else + # echo "❌ Error: .next folder does not exist!" + # fi - echo "=======================" - echo "3. Deep check of .next (excluding node_modules):" - # 查找 .next 目录下 4 层深度的文件,但排除 node_modules 避免日志太长 - find .next -maxdepth 4 -not -path '*/node_modules*' + # echo "=======================" + # echo "3. Deep check of .next (excluding node_modules):" + # # 查找 .next 目录下 4 层深度的文件,但排除 node_modules 避免日志太长 + # find .next -maxdepth 4 -not -path '*/node_modules*' - # - name: Prepare standalone build - # run: | - # cp -r public .next/standalone/public - # cp -r .next/static .next/standalone/.next/static - # cp Dockerfile .next/standalone/Dockerfile + - name: Prepare standalone build + run: | + mkdir -p .next/standalone/public + mkdir -p .next/standalone/.next/static - # - name: Upload production build artifact - # uses: actions/upload-artifact@v3 - # with: - # name: next-build - # path: .next/standalone + cp -r public/* .next/standalone/public/ + cp -r .next/static/* .next/standalone/.next/static/ + cp Dockerfile .next/standalone/Dockerfile - # deploy: - # needs: build-and-test - # runs-on: CDCD - # container: - # image: dockerreg.eazygame.cn/node-with-docker:22 - # steps: - # - name: Download artifacts - # uses: actions/download-artifact@v3 - # with: - # name: next-build + - name: Upload production build artifact + uses: actions/upload-artifact@v3 + with: + name: next-build + path: .next/standalone - # - name: Deploy to Docker - # run: | - # docker build -t nextjs-app . - # docker stop nextjs-app || true - # docker rm nextjs-app || true - # docker run -d -p 8015:3000 --restart unless-stopped --name nextjs-app nextjs-app + deploy: + needs: build-and-test + runs-on: CDCD + container: + image: dockerreg.eazygame.cn/node-with-docker:22 + steps: + - name: Download artifacts + uses: actions/download-artifact@v3 + with: + name: next-build + + - name: Deploy to Docker + run: | + docker build -t nextjs-app . + docker stop nextjs-app || true + docker rm nextjs-app || true + docker run -d -p 8015:3000 --restart unless-stopped --name nextjs-app nextjs-app