name: Deploy CI
on:
  push:
    branches:
      - master

jobs:
  build-and-deploy:
    runs-on: ubuntu-latest
    steps:
      - name: checkout
        uses: actions/checkout@master

      - name: install
        run: yarn

      - name: plugins
        run: yarn add umi-plugin-antd-theme umi-plugin-pro umi-plugin-setting-drawer

      - name: fetch-blocks
        run: yarn run pro fetch-blocks

      - name: site
        run: npm run build

      - name: Deploy
        uses: peaceiris/actions-gh-pages@v3
        with:
          deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
          publish_dir: ./dist
          force_orphan: true
