Process HN Jobs #606
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: Process HN Jobs | |
on: | |
# Schedule updates (00:30 && 12:30 UTC daily) | |
schedule: [{ cron: '0 * * * *' }] | |
# Lines below let you run workflow manually and on each commit | |
workflow_dispatch: | |
push: { branches: ['master'] } | |
env: | |
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
SUPABASE_KEY: ${{ vars.SUPABASE_KEY }} | |
jobs: | |
process_hn_jobs: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 2 | |
- uses: pnpm/action-setup@v2 | |
with: | |
version: 8 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
cache: pnpm | |
- run: pnpm install | |
- run: pnpm turbo lint prettier | |
- name: Run Who Is Hiring script | |
run: node apps/registry/scripts/jobs/getLatestWhoIsHiring.js | |
- name: Run gpted.js to process jobs | |
run: | | |
echo "Environment variables check:" | |
echo "SUPABASE_KEY exists: ${{ env.SUPABASE_KEY != '' }}" | |
echo "OPENAI_API_KEY exists: ${{ env.OPENAI_API_KEY != '' }}" | |
echo "Running gpted.js with environment variables..." | |
SUPABASE_KEY="${{ secrets.SUPABASE_KEY }}" OPENAI_API_KEY="${{ secrets.OPENAI_API_KEY }}" node apps/registry/scripts/jobs/gpted.js | |
- name: Vectortize jobs for the vector search index | |
run: SUPABASE_KEY="${{ secrets.SUPABASE_KEY }}" OPENAI_API_KEY="${{ secrets.OPENAI_API_KEY }}" node apps/registry/scripts/jobs/vectorize.js |