chore: 验证完成,还原工作流
Node.js Build / build (push) Failing after 49s

This commit is contained in:
2026-05-29 15:04:06 +08:00
parent 2ea10e2df4
commit 545ed62ce1
+21 -14
View File
@@ -1,21 +1,28 @@
name: Publish to Verdaccio name: Node.js Build
on: on:
push: push:
branches: [ main, master ] branches: [ "main", "master" ]
pull_request:
branches: [ "main", "master" ]
jobs: jobs:
publish: build:
runs-on: docker runs-on: docker # 匹配你 runner 的标签
steps: steps:
- name: Check NPM_TOKEN and configure registry - name: Checkout code
env: uses: actions/checkout@v4
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Install dependencies
run: npm i # 或 npm install
- name: Run build
run: npm run build
- name: Setup npm for Verdaccio
run: | run: |
if [ -z "$NPM_TOKEN" ]; then npm config set registry http://verdaccio:4873/
echo "Error: NPM_TOKEN secret is not set" npm config set //verdaccio:4873/:_authToken ${{ secrets.NPM_TOKEN }}
exit 1
fi - name: Publish package
npm config set registry http://verdaccio:4873/ run: npm publish
npm config set //verdaccio:4873/:_authToken "$NPM_TOKEN"
npm whoami # 验证身份