Skip to content

Commit

Permalink
docs: sync from master
Browse files Browse the repository at this point in the history
  • Loading branch information
czy88840616 committed Dec 24, 2024
1 parent 6d2ae27 commit 0b39741
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 48 deletions.
20 changes: 14 additions & 6 deletions .github/workflows/beta_site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,25 @@ jobs:
node-version: 18
cache: npm

- run: cd site
# 安装根目录依赖
- name: Install root dependencies
run: pnpm install

- name: Install dependencies
run: npm install
- name: Build website
run: npm build
# 构建根目录项目
- name: Build root project
run: pnpm run build --if-present

# 安装和构建 site 目录
- name: Install and build site
working-directory: site
run: |
npm install
npm run build
- name: Upload Build Artifact
uses: actions/upload-pages-artifact@v3
with:
path: build
path: site/build

deploy:
name: Deploy to GitHub Pages
Expand Down
57 changes: 18 additions & 39 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ name: Node.js CI

on:
push:
branches: [v4-next]
branches: [main]
paths-ignore:
- .github/workflows/site.yml
- 'site/**'
- '*.md'
pull_request:
paths-ignore:
- .github/workflows/site.yml
- 'site/**'
- '*.md'

Expand All @@ -16,7 +18,7 @@ jobs:
timeout-minutes: 60
strategy:
matrix:
node-version: [18]
node-version: [16, 18, 'lts/*']
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
services:
Expand Down Expand Up @@ -60,16 +62,16 @@ jobs:
KAFKA_ZOOKEEPER_CONNECT: "zookeeper:2181"
KAFKA_ADVERTISED_PORT: 9092

# postgres:
# image: postgres:alpine
# ports:
# - 5432:5432
# env:
# POSTGRES_DB: db_ci_test
# POSTGRES_USER: postgres
# POSTGRES_PASSWORD: postgres
# # needed because the postgres container does not provide a healthcheck
# options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
# postgres:
# image: postgres:alpine
# ports:
# - 5432:5432
# env:
# POSTGRES_DB: db_ci_test
# POSTGRES_USER: postgres
# POSTGRES_PASSWORD: postgres
# # needed because the postgres container does not provide a healthcheck
# options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

etcd:
image: bitnami/etcd
Expand All @@ -84,42 +86,20 @@ jobs:
- name: Git checkout
uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
run_install: false

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'

- name: Start MongoDB
uses: supercharge/[email protected]
with:
mongodb-version: 4.2

- name: Start Mosquitto
uses: namoshek/mosquitto-github-action@v1
with:
version: 'latest'
ports: '1883:1883 8883:8883'
config: ${{ github.workspace }}/packages/mqtt/scripts/mosquitto.conf
container-name: 'mqtt'

- name: Install dependencies
run: pnpm install

- name: Install codecov
run: pnpm add -g codecov

- name: Build
run: pnpm run build --if-present

- name: Run tests and coverage
run: pnpm run cov
- run: npm run install_npm
- run: npm install && npm install codecov
- run: npm run build --if-present
- run: npm run cov
env:
RABBITMQ_URL: amqp://localhost:${{ job.services.rabbitmq.ports[5672] }}
ALI_SDK_OSS_REGION: ${{ secrets.ALI_SDK_OSS_REGION }}
Expand All @@ -131,7 +111,6 @@ jobs:
ALI_SDK_STS_SECRET: ${{ secrets.ALI_SDK_STS_SECRET }}
ALI_SDK_STS_BUCKET: ${{ secrets.ALI_SDK_STS_BUCKET }}
ALI_SDK_STS_ROLE: ${{ secrets.ALI_SDK_STS_ROLE }}

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4

Expand Down
22 changes: 19 additions & 3 deletions .github/workflows/site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches: [main]
paths:
- .github/workflows/site.yml
- site/**
- CHANGELOG.md
# repository_dispatch:
Expand All @@ -24,13 +25,28 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm run build --if-present
- name: action-zip
uses: montudor/[email protected]

# 安装根目录依赖
- name: Install root dependencies
run: npm install

# 构建根目录项目
- name: Build root project
run: npm run build --if-present

# 安装和构建 site 目录
- name: Install and build site
working-directory: site
run: |
npm install
npm run build
# 打包文档
- name: Zip output
run: zip -r build/document_archive.zip docs i18n blog versioned_docs versioned_sidebars
working-directory: site
run: zip -r build/document_archive.zip docs i18n blog versioned_docs versioned_sidebars
- name: upload files to OSS
uses: fangbinwei/aliyun-oss-website-action@v1
with:
Expand Down

0 comments on commit 0b39741

Please sign in to comment.