Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/social-maintenance.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Social maintenance

# Dispara /api/jobs/social-maintenance cada hora. Vivía como cron de
# vercel.json, pero el plan actual de Vercel no permite frecuencia horaria;
# el disparo se movió aquí. Toda la lógica sigue viviendo exclusivamente en
# el endpoint — este workflow sólo hace la request HTTPS.
on:
schedule:
- cron: "0 * * * *"
workflow_dispatch:

jobs:
trigger:
name: llamar social-maintenance
runs-on: ubuntu-latest
timeout-minutes: 5

steps:
- name: Verificar secret CRON_SECRET
run: |
if [ -z "${{ secrets.CRON_SECRET }}" ]; then
echo "::error::Falta el secret CRON_SECRET. Configúralo en Settings → Secrets and variables → Actions con el mismo valor que en Vercel Environment Variables."
exit 1
fi

- name: Llamar /api/jobs/social-maintenance
env:
CRON_SECRET: ${{ secrets.CRON_SECRET }}
run: |
curl --fail-with-body --silent --show-error \
--max-time 60 \
--connect-timeout 10 \
-H "Authorization: Bearer ${CRON_SECRET}" \
"https://cpp-ceti.vercel.app/api/jobs/social-maintenance"
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"typecheck": "tsc --noEmit",
"test": "vitest run",
"test:watch": "vitest",
"test:integration": "dotenv -e .env.local -- vitest run --config vitest.integration.config.ts",
"postinstall": "prisma generate",
"db:generate": "prisma generate",
"db:push": "dotenv -e .env.local -- prisma db push",
Expand Down
Loading
Loading