workflow:
rules:
- if: '$CI_COMMIT_BRANCH == "develop"'
stages:
- install_deps
- deploy
- publish
variables:
NPM_REGISTRY: "http://npm.xbongbong.com.cn"
NPM_TOKEN: $CI_JOB_TOKEN
cache:
key: ${CI_COMMIT_REF_NAME}
paths:
- node_modules/
- storybook-static/
# 安装依赖
install_deps:
stage: install_deps
script:
- echo "start npm install"
- npm install --legacy-peer-deps
# 静态站点打包并部署
deploy:
stage: deploy
script:
- echo "start npm run build-storybook"
- npm run build-storybook
- echo "start deploy"
- rm -rf /home/nodeServer/dist/
- mv -f storybook-static /home/nodeServer/dist
# npm打包并发布
publish:
stage: publish
before_script:
- echo "//npm.xbongbong.com.cn/:_authToken=\${NPM_TOKEN}" > ~/.npmrc
- npm config set registry $NPM_REGISTRY
script:
- echo "start npm run build"
- npm run build
- echo "start publish"
- npm publish
rules:
- if: '$CI_COMMIT_MESSAGE =~ /^v?\d+\.\d+\.\d+.*$/'
配置文件如上,相同的commit message信息,我在本地使用Git提交时,不会触发publish阶段的任务。而在gitlab网页上使用在线IDE进行编辑时,却能正常触发publish阶段,这是什么原因?