name: Build Pages

on:
  push:
    branches:
      - master
    paths:
      - '**.ts'

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v3

      - name: Install dependencies
        run: |
          sudo apt-get update
          sudo apt-get install -y qttools5-dev-tools gettext

      - name: Build translations
        run: |
          ./release.sh

      - name: Move directory
        run: |
          mv build _site
          cp .github/CNAME _site/CNAME

      - name: Deploy
        uses: peaceiris/actions-gh-pages@v3
        with:
          publish_dir: ./_site
          github_token: ${{ secrets.GITHUB_TOKEN }}
