Browse Source

ci(github action): gh-pages

tags to publish demo and docs
master
mengshukeji 5 years ago
parent
commit
d5830d7410
  1. 37
      .github/workflows/github-demo.yml
  2. 18
      .github/workflows/github-doc.yml
  3. 12
      deploy.bat

37
.github/workflows/github-demo.yml

@ -0,0 +1,37 @@
name: Github pages deploy
on:
push:
branches:
- master
tags:
- v*
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout # 检查项目
uses: actions/checkout@v2
- name: Set up Node.js # Nodejs版本
uses: actions/setup-node@master
with:
node-version: 12.13.0
- name: Install dependencies & Generate static files # 安装依赖打包demo和文档
run: |
node -v
npm install
npm install gulp -g
npm run build
- name: Deploy LuckysheetDemo to GitHub Pages # 发布demo 到github pages
if: success()
uses: crazy-max/ghaction-github-pages@v2
with:
repo: mengshukeji/LuckysheetDemo
target_branch: gh-pages
build_dir: dist
env:
GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }}

18
.github/workflows/github-pages.yml → .github/workflows/github-doc.yml

@ -1,6 +1,11 @@
name: Github pages deploy name: Github pages deploy
on: push on:
push:
branches:
- master
tags:
- doc*
jobs: jobs:
publish: publish:
@ -19,19 +24,8 @@ jobs:
node -v node -v
npm install npm install
npm install gulp -g npm install gulp -g
npm run build
npm run docs:build npm run docs:build
- name: Deploy LuckysheetDemo to GitHub Pages # 发布demo 到github pages
if: success()
uses: crazy-max/ghaction-github-pages@v2
with:
repo: mengshukeji/LuckysheetDemo
target_branch: gh-pages
build_dir: dist
env:
GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }}
- name: Deploy LuckysheetDocs to GitHub Pages # 发布docs 到github pages - name: Deploy LuckysheetDocs to GitHub Pages # 发布docs 到github pages
if: success() if: success()
uses: crazy-max/ghaction-github-pages@v2 uses: crazy-max/ghaction-github-pages@v2

12
deploy.bat

@ -34,6 +34,18 @@ npm version patch
git push -u origin master git push -u origin master
npm publish npm publish
# ==============================================
# test feature branch
git checkout -b fea origin/feature
git pull
## After some test, create PR merge feature to master branch
git checkout master
git branch -d fea
# =============================================== # ===============================================
# test pull request: https://docs.github.com/cn/free-pro-team@latest/github/collaborating-with-issues-and-pull-requests/checking-out-pull-requests-locally # test pull request: https://docs.github.com/cn/free-pro-team@latest/github/collaborating-with-issues-and-pull-requests/checking-out-pull-requests-locally

Loading…
Cancel
Save