name: Deploy docs

on:
  push:
    branches:
      - master

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2

      - name: Setup Hugo
        uses: peaceiris/actions-hugo@v2
        with:
          hugo-version: '0.58.3'
          extended: true

      - name: Build
        run: hugo --minify
        working-directory: docs

      - name: Deploy
        uses: peaceiris/actions-gh-pages@v3
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          force_orphan: true
          commit_message: '[skip ci] Deploy:'
          publish_dir: docs/public
