Skip to content

Add Husky and lint-staged quality gates #3303

Add Husky and lint-staged quality gates

Add Husky and lint-staged quality gates #3303

Workflow file for this run

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