Add Husky and lint-staged quality gates #3303
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: π Deploy Planner | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - dev | |
| pull_request: | |
| env: | |
| # Set `SITE_CACHE_VERSION` as a repository variable so all workflows share one | |
| # knob for invalidation. | |
| SITE_CACHE_VERSION: ${{ vars.SITE_CACHE_VERSION }} | |
| NODE_VERSION: 24 | |
| jobs: | |
| plan: | |
| name: π Plan Deploys | |
| runs-on: ubuntu-latest | |
| permissions: | |
| deployments: read | |
| outputs: | |
| deploy_site: ${{ steps.plan.outputs.deploy_site }} | |
| refresh_content: ${{ steps.plan.outputs.refresh_content }} | |
| index_semantic_content: ${{ steps.plan.outputs.index_semantic_content }} | |
| deploy_search_worker: ${{ steps.plan.outputs.deploy_search_worker }} | |
| deploy_call_kent_audio_worker: | |
| ${{ steps.plan.outputs.deploy_call_kent_audio_worker }} | |
| deploy_oauth_worker: ${{ steps.plan.outputs.deploy_oauth_worker }} | |
| steps: | |
| - name: β¬οΈ Checkout repo | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: β Setup node | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| - name: π Compute deploy plan | |
| id: plan | |
| run: node ./other/compute-deploy-plan.ts "${{ github.sha }}" | |
| env: | |
| GITHUB_EVENT_BEFORE: ${{ github.event.before }} | |
| GITHUB_EVENT_NAME: ${{ github.event_name }} | |
| GITHUB_REF_NAME: ${{ github.ref_name }} | |
| GITHUB_BASE_REF: ${{ github.base_ref }} | |
| GITHUB_REPOSITORY: ${{ github.repository }} | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: β Deploy plan | |
| run: | | |
| echo "deploy_site: ${{ steps.plan.outputs.deploy_site }}" | |
| echo "refresh_content: ${{ steps.plan.outputs.refresh_content }}" | |
| echo "index_semantic_content: ${{ steps.plan.outputs.index_semantic_content }}" | |
| echo "deploy_search_worker: ${{ steps.plan.outputs.deploy_search_worker }}" | |
| echo "deploy_call_kent_audio_worker: ${{ steps.plan.outputs.deploy_call_kent_audio_worker }}" | |
| echo "deploy_oauth_worker: ${{ steps.plan.outputs.deploy_oauth_worker }}" | |
| deploy-site: | |
| name: π Site Pipeline | |
| needs: [plan] | |
| if: needs.plan.outputs.deploy_site == 'true' | |
| uses: ./.github/workflows/deploy-site.yml | |
| with: | |
| should_deploy: | |
| ${{ github.event_name == 'push' && (github.ref_name == 'main' || | |
| github.ref_name == 'dev') }} | |
| run_pre_deploy_health_check: | |
| ${{ github.event_name == 'push' && github.ref_name == 'main' }} | |
| secrets: inherit | |
| refresh-content: | |
| name: π₯¬ Refresh Content | |
| needs: [plan] | |
| if: | |
| ${{ github.event_name == 'push' && needs.plan.outputs.refresh_content == | |
| 'true' }} | |
| uses: ./.github/workflows/refresh-content.yml | |
| with: | |
| current_commit_sha: ${{ github.sha }} | |
| secrets: inherit | |
| index-semantic-content: | |
| name: π Index Semantic Search (content) | |
| needs: [plan] | |
| if: | |
| ${{ github.ref == 'refs/heads/main' && github.event_name == 'push' && | |
| needs.plan.outputs.index_semantic_content == 'true' }} | |
| uses: ./.github/workflows/index-semantic-content.yml | |
| with: | |
| before_sha: ${{ github.event.before }} | |
| current_commit_sha: ${{ github.sha }} | |
| secrets: inherit | |
| deploy-search-worker: | |
| name: βοΈ Deploy Search Worker | |
| needs: [plan] | |
| if: | |
| ${{ github.ref == 'refs/heads/main' && github.event_name == 'push' && | |
| needs.plan.outputs.deploy_search_worker == 'true' }} | |
| uses: ./.github/workflows/deploy-search-worker.yml | |
| secrets: inherit | |
| deploy-call-kent-audio-worker: | |
| name: βοΈ Deploy Call Kent Audio Worker | |
| needs: [plan] | |
| if: | |
| ${{ github.ref == 'refs/heads/main' && github.event_name == 'push' && | |
| needs.plan.outputs.deploy_call_kent_audio_worker == 'true' }} | |
| uses: ./.github/workflows/deploy-call-kent-audio-worker.yml | |
| secrets: inherit | |
| deploy-oauth-worker: | |
| name: π Deploy OAuth Worker | |
| needs: [plan] | |
| if: | |
| ${{ github.ref == 'refs/heads/main' && github.event_name == 'push' && | |
| needs.plan.outputs.deploy_oauth_worker == 'true' }} | |
| uses: ./.github/workflows/deploy-oauth-worker.yml | |
| secrets: inherit |