Skip to content

Commit 1962901

Browse files
committed
refactor CI to use reusable workflows
1 parent 8344022 commit 1962901

File tree

4 files changed

+43
-22
lines changed

4 files changed

+43
-22
lines changed

.github/workflows/_build_data.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: _build_data
3+
4+
on:
5+
workflow_call:
6+
inputs: {}
7+
8+
jobs:
9+
build-data:
10+
name: Build Data
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/[email protected]
15+
16+
- name: Build data
17+
working-directory: data
18+
run: |
19+
npm run build:posts
20+
npm run build:rss
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
name: _build_frontend
3+
4+
on:
5+
workflow_call:
6+
inputs: {}
7+
8+
jobs:
9+
build-frontend:
10+
name: Build Frontend
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/[email protected]
15+
16+
- name: Build Site
17+
run: |
18+
cd frontend
19+
npm ci
20+
echo "{}" > src/posts.json
21+
npm run build

.github/workflows/ci.yml

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,9 @@ on:
1111
jobs:
1212
build-frontend:
1313
name: Build Frontend
14-
runs-on: ubuntu-latest
15-
steps:
16-
- name: Checkout
17-
uses: actions/[email protected]
18-
19-
- name: Build Site
20-
run: |
21-
cd frontend
22-
npm ci
23-
echo "{}" > src/posts.json
24-
npm run build
14+
uses: ./github/workflows/_build_frontend.yml@main
2515

2616

2717
build-data:
2818
name: Build Data
29-
runs-on: ubuntu-latest
30-
steps:
31-
- name: Checkout
32-
uses: actions/[email protected]
33-
34-
- name: Build data
35-
working-directory: data
36-
run: |
37-
npm run build:posts
38-
npm run build:rss
19+
uses: ./github/workflows/_build_data.yml@main

frontend/src/routes/posts/+page.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@ import { getPosts } from '$lib/utils/loader.js';
33

44
export const load = ({fetch}) => {
55
return getPosts(fetch);
6-
76
}

0 commit comments

Comments
 (0)