name: GitHub Pages

on:
  push:
    branches:
      - master
  pull_request:
    branches:
      - master

jobs:
  deploy:
    name: Deploy
    runs-on: ubuntu-24.04

    steps:
      - name: Checkout
        uses: actions/checkout@v3

      - uses: actions/setup-node@v3
        with:
          node-version: 16
    
      - name: Install dependencies
        run: yarn install --frozen-lockfile

      - name: Build
        run: yarn run build

      - name: Deploy
        if: github.ref == 'refs/heads/master'
        uses: peaceiris/actions-gh-pages@v3
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          publish_dir: ./.vuepress/dist
          cname: pterodactyl.io
