Skip to content

Commit a539e79

Browse files
committed
Fix CI
1 parent 455b369 commit a539e79

2 files changed

Lines changed: 17 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_CONTENT_URL: ${{ secrets.NEXT_GHOST_CMS_CONTENT_URL }}

src/lib/getPosts.ts

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

519
const response = await fetch(endpoint);

0 commit comments

Comments
 (0)