Skip to content

Commit 3282907

Browse files
committed
tweak(ci): translation cron
1 parent e305510 commit 3282907

File tree

1 file changed

+35
-13
lines changed

1 file changed

+35
-13
lines changed

.github/workflows/cron.yml

+35-13
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,23 @@ on:
55
- cron: "0 9 * * 3"
66
workflow_dispatch:
77

8+
env:
9+
LTS_BRANCH: i18n-ja-release-8.5
10+
CLOUD_BRANCH: i18n-ja-release-8.1
11+
812
jobs:
913
ja:
1014
runs-on: ubuntu-latest
15+
strategy:
16+
matrix:
17+
branch: [${{ env.LTS_BRANCH }}, ${{ env.CLOUD_BRANCH }}]
1118

1219
steps:
20+
- name: Skip duplicate branch
21+
if: ${{ matrix.branch == env.LTS_BRANCH && env.LTS_BRANCH == env.CLOUD_BRANCH }}
22+
run: echo "Skipping duplicate branch ${{ matrix.branch }}"
23+
continue-on-error: true
24+
1325
- uses: actions/checkout@v4
1426
name: Download translator repo
1527
with:
@@ -18,7 +30,7 @@ jobs:
1830
- uses: actions/checkout@v4
1931
name: Download docs repo and specified branch
2032
with:
21-
ref: "i18n-ja-release-8.1"
33+
ref: "${{ matrix.branch }}"
2234
path: "docs"
2335
- uses: actions/setup-node@v4
2436
name: Setup node 18
@@ -63,6 +75,16 @@ jobs:
6375
git commit -m "update translated files"
6476
git push
6577
78+
- name: trigger docs-staging workflow
79+
run: |
80+
curl \
81+
-X POST \
82+
-H "Accept: application/vnd.github+json" \
83+
-H "Authorization: token ${{ secrets.DOCS_STAGING }}" \
84+
https://api.github.com/repos/pingcap/docs-staging/actions/workflows/update.yml/dispatches \
85+
-d '{"ref":"main","inputs":{"full": "false", "repo":"${{ github.repository }}","branch":"${{ matrix.branch }}"}}'
86+
87+
6688
# When ja-kernal version is different with cloud, open the comment and run the github action!
6789
# ja-cloud:
6890
# runs-on: ubuntu-latest
@@ -120,16 +142,16 @@ jobs:
120142
# git add .
121143
# git commit -m "update translated files"
122144
# git push
123-
dispatch:
124-
runs-on: ubuntu-latest
125-
needs: [ja]
145+
# dispatch:
146+
# runs-on: ubuntu-latest
147+
# needs: [ja]
126148

127-
steps:
128-
- name: trigger docs-staging workflow
129-
run: |
130-
curl \
131-
-X POST \
132-
-H "Accept: application/vnd.github+json" \
133-
-H "Authorization: token ${{ secrets.DOCS_STAGING }}" \
134-
https://api.github.com/repos/pingcap/docs-staging/actions/workflows/update.yml/dispatches \
135-
-d '{"ref":"main","inputs":{"full": "false", "repo":"${{ github.repository }}","branch":"i18n-ja-release-8.1"}}'
149+
# steps:
150+
# - name: trigger docs-staging workflow
151+
# run: |
152+
# curl \
153+
# -X POST \
154+
# -H "Accept: application/vnd.github+json" \
155+
# -H "Authorization: token ${{ secrets.DOCS_STAGING }}" \
156+
# https://api.github.com/repos/pingcap/docs-staging/actions/workflows/update.yml/dispatches \
157+
# -d '{"ref":"main","inputs":{"full": "false", "repo":"${{ github.repository }}","branch":"i18n-ja-release-8.1"}}'

0 commit comments

Comments
 (0)