Files
neutrino-proxy/.workflow/pipeline-docs-build.yml
T

73 lines
2.3 KiB
YAML

version: '1.0'
name: pipeline-docs-build
displayName: 官网静态资源构建
triggers:
trigger: auto
push:
branches:
precise:
- dev
paths:
include:
- ^neutrino-proxy-vuepress.*
stages:
- name: stage-build
displayName: 构建
strategy: naturally
trigger: auto
executor:
- asgc
steps:
- step: build@nodejs
name: build_nodejs
displayName: Nodejs 构建
nodeVersion: 14.16.0
commands:
- '# 切换到工作目录'
- ''
- cd ./neutrino-proxy-vuepress
- '# 设置NPM源,提升安装速度'
- npm config set registry https://registry.npmmirror.com
- ''
- '# 执行编译命令'
- npm install && npm run build
- ''
- '# 资源复制,使得官网访问支持直接域名访问 + 域名后面带路径 2种访问方式'
- cp ./CNAME docs/.vuepress/dist/
- rm -rf docs/.vuepress/dist/neutrino-proxy
- rm -rf docs/.vuepress/distTemp
- cp -rf docs/.vuepress/dist/ docs/.vuepress/distTemp
- cp -rf docs/.vuepress/distTemp docs/.vuepress/dist/neutrino-proxy
- rm -rf docs/.vuepress/distTemp
- ''
- '# 将构建产物推送到目标分支'
- echo 'hello1111'
- echo $mytoken
- echo ${mytoken}
- cd docs/.vuepress/dist
- git init
- GIT_REPO_URL=https://gitee.com/dromara/neutrino-proxy.git
- GIT_NAME=aoshiguchen
- GIT_USERNAME=asgc
- [email protected]
- GIT_TOKEN=9ea8d4a34d8ea940ccf497ed1c24c69f
- echo "https://${GIT_USERNAME}:${GIT_TOKEN}@${GIT_REPO_URL#https://}" > ~/.git-credentials
- git config --global credential.helper store
- git remote add origin ${GIT_REPO_URL}
- git config user.name ${GIT_NAME}
- git config user.email ${GIT_EMAIL}
- git add -A
- git commit -m "update"
- git checkout -b tmp/test1
- git push -f origin tmp/test1
artifacts:
- name: BUILD_ARTIFACT
path:
- ./neutrino-proxy-vuepress/docs/.vuepress/dist
caches:
- ~/.npm
- ~/.yarn
notify: []
strategy:
retry: '0'