Initial release: Nepal Election 2026 candidate database #1
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: Sync to Supabase | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'data/**/*.yml' | |
| - 'data/**/*.yaml' | |
| workflow_dispatch: # Allow manual trigger | |
| jobs: | |
| sync: | |
| runs-on: ubuntu-latest | |
| environment: production | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Validate YAML files | |
| run: npm run validate-data | |
| - name: Build JSON from YAML | |
| run: npm run build-data | |
| - name: Sync to Supabase | |
| env: | |
| SUPABASE_URL: ${{ secrets.SUPABASE_URL }} | |
| SUPABASE_SERVICE_KEY: ${{ secrets.SUPABASE_SERVICE_KEY }} | |
| run: npm run sync-supabase | |
| - name: Notify on success | |
| if: success() | |
| run: echo "✅ Data synced to Supabase successfully" | |
| - name: Notify on failure | |
| if: failure() | |
| run: echo "❌ Failed to sync data to Supabase" |