tachybase_todo/.github/workflows/deploy-client-docs.yml
2023-11-06 17:53:59 +08:00

45 lines
1.2 KiB
YAML

name: deploy client docs
on:
push:
branches:
- 'main'
paths:
- 'packages/core/client/**'
- '.github/workflows/deploy-client-docs.yml'
pull_request:
branches:
- '**'
paths:
- 'packages/core/client/**'
- '.github/workflows/deploy-client-docs.yml'
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "18"
- run: yarn install
- name: Build
run: yarn doc build core/client
- 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 }}
uses: appleboy/scp-action@v0.1.4
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 }}