name: Build and Deploy

on:
  push:
    branches:
      - master

jobs:
  build-and-deploy:
    runs-on: ubuntu-latest
    steps:
      - name: Set up Node 🖥️
        uses: actions/setup-node@v1
        with:
          node-version: 12

      - name: Checkout 🛎️
        uses: actions/checkout@v2 # If you're using actions/checkout@v2 you must set persist-credentials to false in most cases for the deployment to work correctly.

      - name: Install and Build 🔧
        run: |
          yarn && yarn build && yarn link
          cd example && yarn install && yarn link frameless-titlebar
          yarn run build
        env:
          CI: ""

      - name: Deploy 🚀
        uses: JamesIves/github-pages-deploy-action@releases/v3
        with:
          ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
          BRANCH: gh-pages # The branch the action should deploy to.
          FOLDER: example/build # The folder the action should deploy.
