2024-10-13 03:30:54 +00:00
|
|
|
name: Deploy client docs
|
2024-02-08 03:35:59 +00:00
|
|
|
|
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2023-11-06 09:53:59 +00:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- 'main'
|
|
|
|
paths:
|
|
|
|
- 'packages/core/client/**'
|
2023-12-06 08:20:31 +00:00
|
|
|
- 'packages/core/client/docs/**'
|
2023-11-06 09:53:59 +00:00
|
|
|
- '.github/workflows/deploy-client-docs.yml'
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- '**'
|
|
|
|
paths:
|
2024-05-29 01:33:23 +00:00
|
|
|
- 'packages/core/client/**'
|
2023-12-06 08:20:31 +00:00
|
|
|
- 'packages/core/client/docs/**'
|
2023-11-06 09:53:59 +00:00
|
|
|
- '.github/workflows/deploy-client-docs.yml'
|
|
|
|
|
2023-11-06 03:50:13 +00:00
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
name: Build
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2024-10-13 03:30:54 +00:00
|
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-node@v4
|
|
|
|
with:
|
|
|
|
node-version: 18
|
|
|
|
cache: 'yarn'
|
|
|
|
- run: yarn install
|
|
|
|
- name: Build zh-CN
|
|
|
|
run: yarn doc build core/client --lang=zh-CN
|
|
|
|
- name: Build en-US
|
|
|
|
run: yarn doc build core/client --lang=en-US
|
|
|
|
- name: Set tags
|
|
|
|
id: set-tags
|
|
|
|
run: |
|
|
|
|
if [[ "${{ github.ref_name }}" == "main" ]]; then
|
|
|
|
echo "::set-output name=tags::${{ github.ref_name }}"
|
|
|
|
else
|
|
|
|
echo "::set-output name=tags::pr-${{ github.event.pull_request.number }}"
|
|
|
|
fi
|
|
|
|
- name: copy files via ssh - ${{ steps.set-tags.outputs.tags }}
|
2024-10-20 02:47:01 +00:00
|
|
|
uses: appleboy/scp-action@v0.1.7
|
2024-10-13 03:30:54 +00:00
|
|
|
with:
|
|
|
|
host: ${{ secrets.CN_CLIENT_HOST }}
|
|
|
|
username: ${{ secrets.CN_CLIENT_USERNAME }}
|
|
|
|
key: ${{ secrets.CN_CLIENT_KEY }}
|
|
|
|
port: ${{ secrets.CN_CLIENT_PORT }}
|
|
|
|
source: 'packages/core/client/dist/*'
|
|
|
|
target: ${{ secrets.CN_CLIENT_TARGET }}/${{ steps.set-tags.outputs.tags }}
|