43 lines
1.0 KiB
YAML
43 lines
1.0 KiB
YAML
name: Deploy Live Editor
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
- develop
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
|
|
- uses: actions/setup-node@v3
|
|
with:
|
|
node-version: '16'
|
|
cache: yarn
|
|
|
|
- name: Build & Deploy
|
|
run: |
|
|
npm i -g yarn
|
|
export DEPLOY=true
|
|
[ "$GITHUB_EVENT_NAME" == "pull_request" ] && export BETA=true && rm -rf docs/beta/
|
|
[ "$GITHUB_EVENT_NAME" != "pull_request" ] && rm -rf docs/_app/
|
|
yarn install
|
|
yarn run lint
|
|
version=$(yarn version --patch --no-git-tag-version | grep "New version" | cut -d':' -f 2)
|
|
yarn build
|
|
cd bin
|
|
./fix-path
|
|
cd ..
|
|
|
|
- name: Deploy
|
|
uses: peaceiris/actions-gh-pages@v3
|
|
if: ${{ github.ref == 'refs/heads/master' }}
|
|
with:
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
publish_dir: ./docs
|
|
keep_files: true
|