33 lines
815 B
YAML
33 lines
815 B
YAML
name: Node.js Build
|
|
|
|
on:
|
|
push:
|
|
branches: ["main", "master"]
|
|
pull_request:
|
|
branches: ["main", "master"]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: docker # 匹配你 runner 的标签
|
|
steps:
|
|
- name: Checkout code
|
|
run: |
|
|
git init
|
|
git remote add origin http://gitea:3000/windychen/windyChenUtils.git
|
|
git fetch --depth 1 origin ${{ github.sha }}
|
|
git checkout ${{ github.sha }}
|
|
|
|
- name: Setup npm for Verdaccio
|
|
run: |
|
|
npm config set registry http://verdaccio:4873/
|
|
npm config set //verdaccio:4873/:_authToken ${{ secrets.NPM_TOKEN }}
|
|
|
|
- name: Install dependencies
|
|
run: npm i --registry http://verdaccio:4873/
|
|
|
|
- name: Run build
|
|
run: npm run build
|
|
|
|
- name: Publish package
|
|
run: npm publish
|