Skip to content

Commit d637611

Browse files
authored
Merge pull request #1 from Zero-Sugar0/main
2 parents 0fc5b5e + e154427 commit d637611

2 files changed

Lines changed: 36 additions & 0 deletions

File tree

.github/workflows/main.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Keep Render Service Alive
2+
3+
on:
4+
workflow_dispatch: # run manually
5+
push:
6+
branches:
7+
- main # or whichever branch you deploy from
8+
9+
jobs:
10+
qstash-keepalive:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout repo
14+
uses: actions/checkout@v3
15+
16+
- name: Install curl
17+
run: sudo apt-get install -y curl
18+
19+
- name: Create/Update QStash schedule
20+
env:
21+
QSTASH_TOKEN: ${{ secrets.QSTASH_TOKEN }}
22+
run: |
23+
curl -X POST "https://qstash-us-east-1.upstash.io/v1/schedules" \
24+
-H "Authorization: Bearer $QSTASH_TOKEN" \
25+
-H "Content-Type: application/json" \
26+
-d '{
27+
"cron": "*/14 * * * *",
28+
"destination": "https://eltes.onrender.com/health",
29+
"method": "GET"
30+
}'

app/api/health/route.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// app/api/health/route.ts
2+
import { NextResponse } from "next/server";
3+
4+
export async function GET() {
5+
return NextResponse.json({ status: "OK" }, { status: 200 });
6+
}

0 commit comments

Comments
 (0)