Skip to content

Commit 559cd92

Browse files
committed
add local link and build job
1 parent a053279 commit 559cd92

File tree

3 files changed

+45
-42
lines changed

3 files changed

+45
-42
lines changed

.github/workflows/links.yaml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,14 @@ jobs:
3737
runs-on: ubuntu-latest
3838
steps:
3939
- uses: actions/checkout@v4
40-
- uses: oven-sh/setup-bun@v2
4140

42-
- name: Install and build site
43-
run: |
44-
bun install
45-
cd packages/nuekit
46-
bun link
47-
cd ../nuejs.org
48-
nue build -p
49-
nue -pP 8080 &
41+
- name: Nue build
42+
uses: ./.github/workflows/nue-build.yaml
43+
with:
44+
root: packages/nuejs.org
45+
46+
- name: Run server
47+
run: nue -pr packages/nuejs.org -P 8080 &
5048

5149
- name: Find files to check
5250
id: files

.github/workflows/nue-build.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Local nue build
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
root:
7+
default: '.'
8+
type: string
9+
10+
jobs:
11+
nue-build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: oven-sh/setup-bun@v2
15+
16+
- name: Install and link nue
17+
run: |
18+
bun install
19+
cd packages/nuekit/
20+
bun link
21+
22+
- name: Build Nue Project
23+
run: nue build -pr ${{ inputs.root }}

.github/workflows/publish.yaml

Lines changed: 15 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -31,27 +31,16 @@ jobs:
3131
- uses: actions/checkout@v4
3232

3333
- name: Check dir changes
34-
run: |
35-
git diff --name-only HEAD^ HEAD | grep -q "^${{ env.dir }}"
36-
37-
- uses: oven-sh/setup-bun@v2
38-
39-
- name: Install
40-
run: bun install
34+
run: git diff --name-only HEAD^ HEAD | grep -q "^${{ env.dir }}"
4135

4236
- name: Setup Pages
4337
id: pages
4438
uses: actions/configure-pages@v5
4539

46-
- name: Build
47-
run: |
48-
# link nue
49-
cd packages/nuekit/
50-
bun link
51-
cd -
52-
53-
# build
54-
nue build -pr ${{ env.dir }}
40+
- name: Nue build
41+
uses: ./.github/workflows/nue-build.yaml
42+
with:
43+
root: ${{ env.dir }}
5544

5645
- name: Upload artifact
5746
uses: actions/upload-pages-artifact@v3
@@ -78,35 +67,28 @@ jobs:
7867
- uses: actions/checkout@v4
7968

8069
- name: Check dir changes
81-
run: |
82-
git diff --name-only HEAD^ HEAD | grep -q "^${{ env.dir }}"
83-
84-
- uses: oven-sh/setup-bun@v2
85-
86-
- name: Install
87-
run: bun install
70+
run: git diff --name-only HEAD^ HEAD | grep -q "^${{ env.dir }}"
8871

8972
- name: Setup Pages
9073
id: pages
9174
uses: actions/configure-pages@v5
9275

93-
- name: Build and compress
76+
- name: Create source archive
9477
run: |
95-
# link nue
96-
cd packages/nuekit/
97-
bun link
98-
cd -
99-
100-
# build and archive source
101-
nue build -pr ${{ env.dir }}
102-
git archive -o ${{ env.dir }}.dist/prod/source.tar.gz HEAD:${{ env.dir }}
78+
# source archive
79+
git archive -o ${{ env.dir }}source.tar.gz HEAD:${{ env.dir }}
10380
10481
# small test archive
10582
if [[ "${{ matrix.dir }}" = "simple-blog" ]]; then
10683
cd ${{env.dir}}
107-
tar --exclude ".dist" --exclude "*/img/**" -cf .dist/prod/test.tar.gz .
84+
tar --exclude ".dist" --exclude "*/img/**" -cf test.tar.gz .
10885
fi
10986
87+
- name: Nue build
88+
uses: ./.github/workflows/nue-build.yaml
89+
with:
90+
root: ${{ env.dir }}
91+
11092
- name: Upload artifact
11193
uses: actions/upload-pages-artifact@v3
11294
with:

0 commit comments

Comments
 (0)