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

jobs:
  deploy:
    runs-on: ubuntu-latest
    needs: build
    if: github.ref == 'refs/heads/master'
    steps:
      - name: Build Site
        uses: ./.github/workflows/common/build-site.yml

      - name: Deploy to GitHub Pages
        if: success()
        uses: crazy-max/ghaction-github-pages@v2
        with:
          target_branch: gh-pages
          build_dir: public
          fqdn: ewpratten.com
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}