2020-02-21 01:18:31 +08:00
|
|
|
name: deploy
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build-and-deploy:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2020-02-21 01:49:22 +08:00
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
persist-credentials: false
|
|
|
|
- name: Setup Node.js
|
|
|
|
uses: actions/setup-node@v1
|
|
|
|
with:
|
2021-08-12 18:47:19 +08:00
|
|
|
node-version: 14
|
2020-02-21 01:49:22 +08:00
|
|
|
- name: NPM Install and Test
|
|
|
|
run: |
|
|
|
|
npm install
|
|
|
|
npm run test
|
|
|
|
npm run build
|
|
|
|
- name: Publish
|
|
|
|
uses: JS-DevTools/npm-publish@v1
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.NPM_TOKEN }}
|
|
|
|
- name: Deploy to gh-pages
|
|
|
|
uses: JamesIves/github-pages-deploy-action@releases/v3
|
|
|
|
with:
|
|
|
|
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
|
|
|
|
BRANCH: gh-pages
|
|
|
|
FOLDER: _site
|