Use github action to do deployment (#480)
* Create deploy.yml
* Update CI.yml
diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml
index de4b98f..b603871 100644
--- a/.github/workflows/CI.yml
+++ b/.github/workflows/CI.yml
@@ -1,10 +1,9 @@
name: CI
-on: [push,pull_request]
+on: [pull_request]
jobs:
- build:
-
+ Build:
runs-on: ubuntu-latest
strategy:
@@ -17,7 +16,7 @@
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- - name: npm install and build
+ - name: Npm install and build
run: |
npm install
npm run build --if-present
diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
new file mode 100644
index 0000000..702e6d3
--- /dev/null
+++ b/.github/workflows/deploy.yml
@@ -0,0 +1,28 @@
+name: Website deploy
+
+on:
+ push:
+ branches:
+ - master
+
+jobs:
+ Build-Deploy:
+ runs-on: ubuntu-18.04
+ steps:
+ - uses: actions/checkout@master
+
+ - name: Use Node.js ${{ matrix.node-version }}
+ uses: actions/setup-node@v1
+ with:
+ node-version: ${{ matrix.node-version }}
+ - name: Build
+ run: |
+ npm install && npm run build && mkdir deploy-dist && cp -R zh-cn/ en-us/ build/ img/ schema/ md_json/ deploy-dist/ && mv *.html *.xml deploy-dist/
+ - name: Deploy
+ uses: peaceiris/actions-gh-pages@v2.4.0
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ PUBLISH_BRANCH: asf-site
+ PUBLISH_DIR: ./deploy-dist
+ with:
+ keepFiles: true