name: Deploy Company Site

on:
  workflow_run:
    workflows: [Unit Tests]
    types: [completed]
    branches: [master]

jobs:
  deploy:
    if: gitea.event.workflow_run.conclusion == 'success' && gitea.event.workflow_run.event == 'push'
    runs-on: self-hosted
    steps:
      - name: Checkout
        uses: actions/checkout@v4
        with:
          ref: ${{ gitea.event.workflow_run.head_sha }}

      - name: Deploy to live site
        run: bash scripts/deploy.sh "${{ gitea.workspace }}"
