Skip to content

Commit

Permalink
ci: enhance CI workflow with improved build commands and error handli…
Browse files Browse the repository at this point in the history
…ng; update Astro configuration for server output and add starlight-docsearch dependency
  • Loading branch information
erguotou520 committed Jan 1, 2025
1 parent 60de1a9 commit 7d75454
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 12 deletions.
24 changes: 14 additions & 10 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,27 +50,33 @@ jobs:
- host: ubuntu-latest
target: x86_64-unknown-linux-gnu
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian
prepare: apt-get update && apt-get install -y pkg-config libssl-dev
build: yarn workspace @doremijs/igit-core build --target x86_64-unknown-linux-gnu
build: |-
set -e &&
apt-get update && apt-get install -y build-essential pkg-config libssl-dev &&
yarn workspace @doremijs/igit-core build --target x86_64-unknown-linux-gnu
- host: ubuntu-latest
target: x86_64-unknown-linux-musl
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
prepare: apk add --no-cache openssl-dev pkgconfig
build: yarn workspace @doremijs/igit-core build --target x86_64-unknown-linux-musl
build: |-
set -e &&
apk add --no-cache openssl-dev pkgconfig &&
yarn workspace @doremijs/igit-core build --target x86_64-unknown-linux-musl
- host: macos-latest
target: aarch64-apple-darwin
build: yarn workspace @doremijs/igit-core build --target aarch64-apple-darwin
- host: ubuntu-latest
target: aarch64-unknown-linux-gnu
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian-aarch64
prepare: apt-get update && apt-get install -y pkg-config libssl-dev
build: yarn workspace @doremijs/igit-core build --target aarch64-unknown-linux-gnu
build: |-
set -e &&
apt-get update && apt-get install -y build-essential pkg-config libssl-dev &&
yarn workspace @doremijs/igit-core build --target aarch64-unknown-linux-gnu
- host: ubuntu-latest
target: aarch64-unknown-linux-musl
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
prepare: apk add --no-cache openssl-dev pkgconfig
build: |-
set -e &&
apk add --no-cache openssl-dev pkgconfig &&
rustup target add aarch64-unknown-linux-musl &&
yarn workspace @doremijs/igit-core build --target aarch64-unknown-linux-musl
- host: windows-latest
Expand Down Expand Up @@ -130,9 +136,7 @@ jobs:
image: ${{ matrix.settings.docker }}
options: '--user 0:0 -v ${{ github.workspace }}/.cargo-cache/git/db:/usr/local/cargo/git/db -v ${{ github.workspace }}/.cargo/registry/cache:/usr/local/cargo/registry/cache -v ${{ github.workspace }}/.cargo/registry/index:/usr/local/cargo/registry/index -v ${{ github.workspace }}:/build -w /build'
shell: bash
run: |
${{ matrix.settings.prepare }}
${{ matrix.settings.build }}
run: ${{ matrix.settings.build }}
- name: Build
run: ${{ matrix.settings.build }}
if: ${{ !matrix.settings.docker }}
Expand Down
13 changes: 11 additions & 2 deletions packages/doc/astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import { defineConfig } from 'astro/config';
import starlight from '@astrojs/starlight';
import cloudflare from '@astrojs/cloudflare';
// import starlightDocSearch from '@astrojs/starlight-docsearch';

// https://astro.build/config
export default defineConfig({
output: 'server',
vite: {
ssr: {
noExternal: ['@astrojs/starlight'],
// noExternal: ['@astrojs/starlight'],
external: ['node:path', 'node:url']
}
},
Expand Down Expand Up @@ -75,9 +77,16 @@ export default defineConfig({
},
}
],
// plugins: [
// starlightDocSearch({
// appId: 'YOUR_APP_ID',
// apiKey: 'YOUR_SEARCH_API_KEY',
// indexName: 'YOUR_INDEX_NAME',
// }),
// ],
}),
],
adapter: cloudflare({
imageService: 'cloudflare'
})
}),
});
1 change: 1 addition & 0 deletions packages/doc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"dependencies": {
"@astrojs/starlight": "^0.30.3",
"@astrojs/cloudflare": "^12.1.0",
"@astrojs/starlight-docsearch": "^0.4.0",
"astro": "^5.0.2"
}
}

0 comments on commit 7d75454

Please sign in to comment.