Skip to content

Commit

Permalink
add local link and build job
Browse files Browse the repository at this point in the history
  • Loading branch information
nobkd committed Nov 21, 2024
1 parent a053279 commit 6d088f3
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 42 deletions.
16 changes: 7 additions & 9 deletions .github/workflows/links.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2

- name: Install and build site
run: |
bun install
cd packages/nuekit
bun link
cd ../nuejs.org
nue build -p
nue -pP 8080 &
- name: Nue build
uses: ./.github/workflows/nue-build.yaml
with:
root: packages/nuejs.org

- name: Run server
run: nue -pr packages/nuejs.org -P 8080 &

- name: Find files to check
id: files
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/nue-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
on:
workflow_call:
inputs:
root:
default: '.'
type: string

jobs:
nue-build:
runs-on: ubuntu-latest
steps:
- uses: oven-sh/setup-bun@v2

- name: Install and link nue
run: |
bun install
cd packages/nuekit/
bun link
- name: Build Nue Project
run: nue build -pr ${{ inputs.root }}
48 changes: 15 additions & 33 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,27 +31,16 @@ jobs:
- uses: actions/checkout@v4

- name: Check dir changes
run: |
git diff --name-only HEAD^ HEAD | grep -q "^${{ env.dir }}"
- uses: oven-sh/setup-bun@v2

- name: Install
run: bun install
run: git diff --name-only HEAD^ HEAD | grep -q "^${{ env.dir }}"

- name: Setup Pages
id: pages
uses: actions/configure-pages@v5

- name: Build
run: |
# link nue
cd packages/nuekit/
bun link
cd -
# build
nue build -pr ${{ env.dir }}
- name: Nue build
uses: ./.github/workflows/nue-build.yaml
with:
root: ${{ env.dir }}

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
Expand All @@ -78,35 +67,28 @@ jobs:
- uses: actions/checkout@v4

- name: Check dir changes
run: |
git diff --name-only HEAD^ HEAD | grep -q "^${{ env.dir }}"
- uses: oven-sh/setup-bun@v2

- name: Install
run: bun install
run: git diff --name-only HEAD^ HEAD | grep -q "^${{ env.dir }}"

- name: Setup Pages
id: pages
uses: actions/configure-pages@v5

- name: Build and compress
- name: Create source archive
run: |
# link nue
cd packages/nuekit/
bun link
cd -
# build and archive source
nue build -pr ${{ env.dir }}
git archive -o ${{ env.dir }}.dist/prod/source.tar.gz HEAD:${{ env.dir }}
# source archive
git archive -o ${{ env.dir }}source.tar.gz HEAD:${{ env.dir }}
# small test archive
if [[ "${{ matrix.dir }}" = "simple-blog" ]]; then
cd ${{env.dir}}
tar --exclude ".dist" --exclude "*/img/**" -cf .dist/prod/test.tar.gz .
tar --exclude ".dist" --exclude "*/img/**" -cf test.tar.gz .
fi
- name: Nue build
uses: ./.github/workflows/nue-build.yaml
with:
root: ${{ env.dir }}

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
Expand Down

0 comments on commit 6d088f3

Please sign in to comment.