Files
mermaid-live-editor/.github/workflows/deploy.yml
T
2021-06-03 00:23:55 +05:30

59 lines
1.5 KiB
YAML

name: Deploy Live Editor
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v2
with:
node-version: '14'
- name: Checkout
uses: actions/checkout@v2
- uses: actions/cache@v2
id: yarn-and-build-cache
with:
path: |
node_modules
key: ${{ runner.os }}-node_modules-build-deploy-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-node_modules-build-deploy-
- name: Setup Beta
if: ${{ github.event_name == 'pull_request' }}
run: |
export BETA=true
rm -rf docs/beta/
- name: Cleanup build
if: ${{ github.event_name != 'pull_request' }}
run: |
rm -rf docs/_app/
- name: Build & Deploy
run: |
npm i -g yarn
export DEPLOY=true
echo "$GITHUB_EVENT_NAME"
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 ..
git config user.name github-actions
git config user.email github-actions@github.com
git config pull.rebase false
git pull origin gh-pages
git add .
git commit -nm "Release $version"
git push origin gh-pages