Skip to content

Commit 5e5faac

Browse files
heyitsOKCopilot
andauthored
Site wide ODR route in favour of routed ODR for hourly revalidation (#227)
* [refactor] replaced route reval triggers with one site-wide trigger * [fix] old api route was replaced with new one * [fix] added "https://" to visit step Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]>
1 parent e0a345b commit 5e5faac

File tree

5 files changed

+6
-35
lines changed

5 files changed

+6
-35
lines changed

.github/workflows/hourly-revalidation.yml

+4-8
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,7 @@ jobs:
88
build:
99
runs-on: ubuntu-latest
1010
steps:
11-
- name: Trigger on demand revalidation for home page
12-
run: curl -X POST -d '{}' "carletonblueprint.org/api/revalidate/home"
13-
- name: Trigger on demand revalidation for projects page
14-
run: curl -X POST -d '{}' "carletonblueprint.org/api/revalidate/projects"
15-
- name: Trigger on demand revalidation for events page
16-
run: curl -X POST -d '{}' "carletonblueprint.org/api/revalidate/events"
17-
- name: Trigger on demand revalidation for students page
18-
run: curl -X POST -d '{}' "carletonblueprint.org/api/revalidate/students"
11+
- name: Trigger on demand revalidation site wide
12+
run: curl -X POST -d '{}' "https://carletonblueprint.org/api/revalidate"
13+
- name: Visit the site
14+
run: curl -X GET "https://carletonblueprint.org"

src/app/api/revalidate/events/route.ts

-8
This file was deleted.

src/app/api/revalidate/home/route.ts

-9
This file was deleted.

src/app/api/revalidate/projects/route.ts

-8
This file was deleted.

src/app/api/revalidate/students/route.ts renamed to src/app/api/revalidate/route.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ import { NextResponse } from 'next/server';
33
import { revalidatePath } from 'next/cache';
44

55
export async function POST() {
6-
revalidatePath('/students');
7-
return NextResponse.json({ message: 'Successfully revalidated /', status: 200 });
6+
revalidatePath('/', 'layout');
7+
return NextResponse.json({ message: 'Successfully revalidated site', status: 200 });
88
}

0 commit comments

Comments
 (0)