diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 2e16f987..e1ae9f4d 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -12,8 +12,18 @@ on: branches: ["main"] # Publish semver tags as releases. tags: ["v*.*.*"] + # Exclude translation files - those are handled by workflow_run after Translate completes + paths-ignore: + - 'apps/web/src/locales/**/*.po' + - 'apps/web/src/locales/**/*.ts' pull_request: branches: ["main"] + workflow_run: + workflows: ["Translate"] + types: [completed] + branches: [main] + # Docker builds after Translate completes (success or failure) + # This ensures Docker always has the latest translations env: # Use docker.io for Docker Hub if empty @@ -23,6 +33,9 @@ env: jobs: build: + concurrency: + group: docker-build-${{ github.ref }} + cancel-in-progress: true runs-on: ubuntu-latest permissions: contents: read diff --git a/.github/workflows/translate.yml b/.github/workflows/translate.yml index 5ff53294..e1dd0832 100644 --- a/.github/workflows/translate.yml +++ b/.github/workflows/translate.yml @@ -22,7 +22,7 @@ jobs: - name: Extract translations working-directory: apps/web - run: npx @lingui/cli extract + run: npx --yes @lingui/cli extract - name: Lingo.dev uses: lingodotdev/lingo.dev@main @@ -30,16 +30,20 @@ jobs: api-key: ${{ secrets.LINGODOTDEV_API_KEY }} commit-message: "chore: update translations" working-directory: apps/web + commit-author-name: "${{ github.actor }}" + commit-author-email: "${{ github.actor }}@users.noreply.github.com" parallel: true - name: Compile translations working-directory: apps/web - run: npx @lingui/cli compile --typescript + run: npx --yes @lingui/cli compile --typescript - name: Commit compiled translations run: | git config --local user.email "${{ github.actor }}@users.noreply.github.com" git config --local user.name "${{ github.actor }}" - git add apps/web/src/locales/*/messages.ts - git diff --staged --quiet || git commit -m "chore: compile translations" - git push + if ls apps/web/src/locales/*/messages.ts 1> /dev/null 2>&1; then + git add apps/web/src/locales/*/messages.ts + git diff --staged --quiet || (git commit -m "chore: compile translations" && git push) + fi +