name: Documentation Build
on:
  push:
    branches:
      - 2.x
jobs:
  build:
    name: Build docs
    runs-on: ubuntu-latest
    steps:
      - name: Checkout the latest code
        uses: actions/checkout@v2
        with:
          token: ${{ secrets.TWILL_PAT_TOKEN }}
          fetch-depth: 0
      - name: Build
        uses: jenkey2011/vuepress-deploy@master
        env:
          ACCESS_TOKEN: ${{ secrets.TWILL_PAT_TOKEN }}
          TARGET_REPO: area17/twill
          TARGET_BRANCH: build/docs
          BUILD_SCRIPT: cd docs && npm ci && VUEPRESS_BASE=twill npm run build
          BUILD_DIR: docs/
