Skip to content

refact(toolbox): 剧情翻译全部调用 Claude #223

refact(toolbox): 剧情翻译全部调用 Claude

refact(toolbox): 剧情翻译全部调用 Claude #223

name: Deploy Toolbox To Production
on:
push:
branches:
- dev
- feat/**
paths:
- "apps/ba-online-toolbox/**"
- "lib/**"
concurrency:
group: "toolbox-deploy"
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
with:
fetch-depth: 0
- uses: actions/setup-node@main
with:
node-version: "18"
- uses: pnpm/action-setup@master
with:
version: latest
- name: Verify Change Logs
run: node common/scripts/install-run-rush.js change --verify
- name: Rush Update
run: node common/scripts/install-run-rush.js update
- name: Rush Install
run: node common/scripts/install-run-rush.js install
- name: Generate secret for translator
env:
YOUDAO_APP_ID: ${{ secrets.YOUDAO_APP_ID }}
YOUDAO_APP_SECRET: ${{ secrets.YOUDAO_APP_SECRET }}
ANTHROPIC_TIER1_SECRET: ${{ secrets.ANTHROPIC_TIER1_SECRET }}
shell: python
run: |
import os
YOUDAO_APP_ID = os.getenv("YOUDAO_APP_ID")
YOUDAO_APP_SECRET = os.getenv("YOUDAO_APP_SECRET")
ANTHROPIC_TIER1_SECRET = os.getenv("ANTHROPIC_TIER1_SECRET")
with open("./apps/ba-online-toolbox/src/tools/public/secrets.json", "w") as f:
f.write(f'{{"YOUDAO_APP_ID": "{YOUDAO_APP_ID}", "YOUDAO_APP_SECRET": "{YOUDAO_APP_SECRET}", "ANTHROPIC_TIER1_SECRET": "{ANTHROPIC_TIER1_SECRET}"}}')
- name: Rush build
run: node common/scripts/install-run-rush.js build --verbose --impacted-by-except blue-archive-story-viewer --to ba-online-toolbox
- name: Toolbox rsync deploy
uses: easingthemes/ssh-deploy@main
with:
SSH_PRIVATE_KEY: ${{ secrets.SERVER_PASS_PRODUCTION }}
ARGS: "-rltgoDzvO"
SOURCE: "./apps/ba-online-toolbox/dist/"
REMOTE_HOST: ${{ secrets.SERVER_HOST_PRODUCTION }}
REMOTE_USER: ${{ secrets.SERVER_USER_PRODUCTION }}
TARGET: "/var/www/toolbox"
EXCLUDE: ".git*"