ci: avoid installing node in deployment runner
Verify mini program and deploy preview / verify-deploy (push) Failing after 29s

This commit is contained in:
2026-09-18 22:21:36 +08:00
parent 96a1f22510
commit f44c802045
2 changed files with 25 additions and 3 deletions
+3 -3
View File
@@ -5,7 +5,7 @@ on:
pull_request:
concurrency:
group: pk-lab-xhs-production
cancel-in-progress: false
cancel-in-progress: true
jobs:
verify-deploy:
runs-on: ubuntu-latest
@@ -22,7 +22,7 @@ jobs:
env: { SOURCE_TOKEN: "${{ secrets.GITEA_TOKEN || gitea.token }}" }
run: |
set -eu
apk add --no-cache python3 nodejs npm curl
apk add --no-cache python3 curl
python3 - <<'PY'
import io,os,shutil,tarfile,tempfile,urllib.request
from pathlib import Path
@@ -34,7 +34,7 @@ jobs:
roots=list(Path(d).iterdir());shutil.copytree(roots[0],Path.cwd(),dirs_exist_ok=True)
PY
- name: Check source and preview
run: npm run check
run: python3 scripts/check.py
- name: Build preview image
run: docker build -t "pk-lab-xhs:$SOURCE_REVISION" .
- name: Update permanent preview container
+22
View File
@@ -0,0 +1,22 @@
import json
from pathlib import Path
required = [
"app.js",
"app.json",
"pages/index/index.xhsml",
"pages/test/test.js",
"pages/result/result.js",
"web/index.html",
"web/app.js",
]
missing = [name for name in required if not Path(name).is_file()]
if missing:
raise SystemExit("Missing required files: " + ", ".join(missing))
json.loads(Path("app.json").read_text())
web = Path("web/index.html").read_text()
if "./app.js" not in web or "./style.css" not in web:
raise SystemExit("Preview assets are not linked")
print(f"Static checks passed ({len(required)} required files).")