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:
push:
branches: [ main, master ]
branches: [ "main", "master" ]
pull_request:
branches: [ "main", "master" ]
jobs:
publish:
runs-on: docker
build:
runs-on: docker # 匹配你 runner 的标签
steps:
- name: Check NPM_TOKEN and configure registry
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies
run: npm i # 或 npm install
- name: Run build
run: npm run build
- name: Setup npm for Verdaccio
run: |
if [ -z "$NPM_TOKEN" ]; then
echo "Error: NPM_TOKEN secret is not set"
exit 1
fi
npm config set registry http://verdaccio:4873/
npm config set //verdaccio:4873/:_authToken "$NPM_TOKEN"
npm whoami # 验证身份
npm config set registry http://verdaccio:4873/
npm config set //verdaccio:4873/:_authToken ${{ secrets.NPM_TOKEN }}
- name: Publish package
run: npm publish