name: Deploy to GH Pages
on:
  push:
    branches: [ master ]
env:
  CARGO_TERM_COLOR: always
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2

      - name: Build WASM
        run: |
          curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
          sh build-wasm.sh

      - name: Install and Build Vuepress
        run: |
          npm install
          npm run just-build

      - name: Deploy
        uses: JamesIves/github-pages-deploy-action@4.1.5
        with:
          branch: gh-pages
          folder: docs/.vuepress/dist
