Skip to content

Commit e4ee26e

Browse files
committed
Fix CI
1 parent 455b369 commit e4ee26e

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

.github/workflows/CI.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,6 @@ jobs:
4343
- name: Build the docs
4444
run: pnpm build
4545
working-directory: website
46+
env:
47+
NEXT_GHOST_CMS_API_KEY: ${{ secrets.NEXT_GHOST_CMS_API_KEY }}
48+
NEXT_GHOST_CMS_API_URL: ${{ secrets.NEXT_GHOST_CMS_API_URL }}

src/lib/getPosts.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
export default async function getPosts() {
22
const API_KEY = process.env.NEXT_GHOST_CMS_API_KEY;
3+
const API_URL = process.env.NEXT_GHOST_CMS_API_URL;
4+
5+
if (!API_KEY || !API_URL) {
6+
if (!process.env.VERCEL_ENV) {
7+
return [];
8+
}
9+
10+
throw new Error(
11+
`Please set NEXT_GHOST_CMS_API_KEY and NEXT_GHOST_CMS_API_URL environment variables`
12+
);
13+
}
14+
315
const endpoint = `${process.env.NEXT_GHOST_CMS_CONTENT_URL}/posts?key=${API_KEY}&filter=tag:[hardhat,hardhat-ignition]`;
416

517
const response = await fetch(endpoint);

0 commit comments

Comments
 (0)