Skip to content

Commit c65ee7c

Browse files
committed
ci(docs): add update-translated-docs workflow
1 parent 5413e4f commit c65ee7c

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

.github/workflows/update-docs.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: "Update Translated Docs"
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'docs/**'
9+
paths-ignore:
10+
- 'docs/src/content/docs/ja/**'
11+
12+
jobs:
13+
update-docs:
14+
if: "!contains(github.event.head_commit.message, 'Update all translated document pages')"
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
- name: Install pnpm
22+
uses: pnpm/action-setup@v4
23+
with:
24+
version: 10.13.1
25+
run_install: false
26+
- name: Setup Node.js
27+
uses: actions/setup-node@v4
28+
with:
29+
node-version: 20
30+
cache: 'pnpm'
31+
- name: Install dependencies
32+
run: pnpm install
33+
- name: Translate docs
34+
env:
35+
OPENAI_API_KEY: ${{ secrets.PROD_OPENAI_API_KEY }}
36+
run: pnpm docs:translate
37+
- name: Commit changes
38+
run: |
39+
git config user.name "github-actions[bot]"
40+
git config user.email "github-actions[bot]@users.noreply.github.com"
41+
git add docs/
42+
if [ -n "$(git status --porcelain)" ]; then
43+
git commit -m "Update all translated document pages"
44+
git push
45+
else
46+
echo "No changes to commit"
47+
fi

0 commit comments

Comments
 (0)