fix: update translate workflow

This commit is contained in:
Henry
2026-02-19 21:19:46 +00:00
parent 32714ccedf
commit 2113cc7873

View File

@@ -1,52 +1,36 @@
name: Translate
on:
push:
branches: [main]
permissions:
contents: write
jobs: jobs:
translate: translate:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v2
with: with:
version: 8 token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Node - name: Setup Node
uses: actions/setup-node@v4 uses: actions/setup-node@v4
with: with:
node-version: 20 node-version: 20
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --filter @kan/web...
- name: Extract translations - name: Extract translations
working-directory: apps/web working-directory: apps/web
run: pnpm lingui:extract run: npx @lingui/cli extract
- name: Lingo.dev - name: Lingo.dev
uses: lingodotdev/lingo.dev@main uses: lingodotdev/lingo.dev@main
with: with:
api-key: ${{ secrets.LINGODOTDEV_API_KEY }} api-key: ${{ secrets.LINGODOTDEV_API_KEY }}
commit-message: "chore: update translations" commit-message: chore: update translations
working-directory: apps/web working-directory: apps/web
parallel: true parallel: true
- name: Compile translations - name: Compile translations
working-directory: apps/web working-directory: apps/web
run: pnpm lingui:compile run: npx @lingui/cli compile --typescript
- name: Commit compiled translations - name: Commit compiled translations
run: | run: |
git config --local user.email "hjball@users.noreply.github.com" git config --local user.email "${{ github.actor }}@users.noreply.github.com"
git config --local user.name "hjball" git config --local user.name "${{ github.actor }}"
git add apps/web/src/locales/*/messages.{js,ts} git add apps/web/src/locales/*/messages.{js,ts}
git diff --staged --quiet || git commit -m "chore: compile translations" git diff --staged --quiet || git commit -m "chore: compile translations"
git push git push