mirror of
https://github.com/twentyhq/twenty.git
synced 2026-06-12 01:46:39 -04:00
## Summary Follow-up to the Cloudflare/OpenNext migration (#20741). Now that the legacy `twenty-website` package was already removed in #20270, the `-new` suffix on the marketing site package is no longer meaningful. ## What changes - **Directory rename**: `git mv packages/twenty-website-new packages/twenty-website` (1213 files moved, no content change) - **Package + nx config**: `package.json` and `project.json` name fields updated, `sourceRoot` repointed - **Source refs**: `load-local-articles.ts` and `load-local-release-notes.ts` had a hardcoded `'twenty-website-new'` segment in their monorepo-root fallback path; `app/[locale]/releases/page.tsx` had display strings showing where to add content - **External refs**: root `package.json` workspaces, root `CLAUDE.md` / `README.md`, `twenty-sdk` + `create-twenty-app` READMEs, `.vscode/twenty.code-workspace`, `.cursor/rules/changelog-process.mdc`, Crowdin config + the three `website-i18n-*` CI workflows + `ci-website.yaml` - **Docker cleanup**: `packages/twenty-docker/twenty-website-new/Dockerfile` deleted; the two Makefile targets (`prod-website-new-build` / `prod-website-new-run`) that referenced it removed — EKS deploy was retired in the Cloudflare migration - **`yarn.lock`** regenerated against the new workspace path ## What's deliberately not in this PR The dev hostname `website-new.twenty-main.com` in `wrangler.jsonc` stays for now. Migrating it to `website.twenty-main.com` needs coordinated DNS deletion (current CNAME points at the legacy Docusaurus NLB and serves 503s) and removal of the matching legacy `website` Helm chart in `twenty-infra`. Flagged as a separate cleanup. Companion infra PR: https://github.com/twentyhq/twenty-infra/pull/682 (workflow paths + Terraform ECR + docs) ## Test plan - [x] `yarn install --immutable` resolves clean against the new path - [x] `npx nx typecheck twenty-website` passes - [x] `npx nx lint twenty-website` passes - [ ] CI on this PR confirms the same on a fresh checkout - [ ] After merge: trigger `Deploy Website` workflow against `environment=dev` to confirm the renamed working-directory deploys correctly
135 lines
4.8 KiB
YAML
135 lines
4.8 KiB
YAML
# Pull down website translations from Crowdin every two hours or when triggered manually.
|
|
# When force_pull input is true, translations will be pulled regardless of compilation status.
|
|
|
|
name: 'Pull website translations from Crowdin'
|
|
|
|
permissions:
|
|
contents: write
|
|
pull-requests: write
|
|
|
|
on:
|
|
schedule:
|
|
- cron: '0 */2 * * *' # Every two hours.
|
|
workflow_dispatch:
|
|
inputs:
|
|
force_pull:
|
|
description: 'Force pull translations regardless of compilation status'
|
|
required: false
|
|
type: boolean
|
|
default: false
|
|
workflow_call:
|
|
inputs:
|
|
force_pull:
|
|
description: 'Force pull translations regardless of compilation status'
|
|
required: false
|
|
type: boolean
|
|
default: false
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
|
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
|
|
|
|
jobs:
|
|
pull_website_translations:
|
|
name: Pull website translations
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
|
|
with:
|
|
token: ${{ github.token }}
|
|
ref: ${{ github.head_ref || github.ref_name }}
|
|
|
|
- name: Setup website i18n branch
|
|
run: |
|
|
git fetch origin i18n-website || true
|
|
git checkout -B i18n-website origin/i18n-website || git checkout -b i18n-website
|
|
|
|
- name: Install dependencies
|
|
uses: ./.github/actions/yarn-install
|
|
|
|
- name: Build twenty-shared
|
|
run: npx nx build twenty-shared
|
|
|
|
# Strict mode fails if there are missing website translations.
|
|
- name: Compile website translations
|
|
id: compile_translations_strict
|
|
run: npx nx run twenty-website:lingui:compile --strict
|
|
continue-on-error: true
|
|
|
|
- name: Stash any changes before pulling translations
|
|
run: |
|
|
git config --global user.name 'github-actions'
|
|
git config --global user.email 'github-actions@twenty.com'
|
|
git add .
|
|
git stash
|
|
|
|
- name: Pull website translations from Crowdin
|
|
if: inputs.force_pull || steps.compile_translations_strict.outcome == 'failure'
|
|
uses: crowdin/github-action@8868a33591d21088edfc398968173a3b98d51706 # v2
|
|
with:
|
|
upload_sources: false
|
|
upload_translations: false
|
|
download_translations: true
|
|
source: 'packages/twenty-website/src/locales/en.po'
|
|
translation: 'packages/twenty-website/src/locales/%locale%.po'
|
|
export_only_approved: false
|
|
localization_branch_name: i18n-website
|
|
base_url: 'https://twenty.api.crowdin.com'
|
|
auto_approve_imported: false
|
|
import_eq_suggestions: false
|
|
download_sources: false
|
|
push_sources: false
|
|
skip_untranslated_strings: false
|
|
skip_untranslated_files: false
|
|
push_translations: false
|
|
create_pull_request: false
|
|
skip_ref_checkout: true
|
|
dryrun_action: false
|
|
config: '.github/crowdin-website.yml'
|
|
env:
|
|
GITHUB_TOKEN: ${{ github.token }}
|
|
# Website translations project
|
|
CROWDIN_PROJECT_ID: '4'
|
|
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
|
|
|
|
# As the files are extracted from a Docker container, they belong to root:root.
|
|
# We need to fix this before the next steps.
|
|
- name: Fix file permissions
|
|
run: sudo chown -R runner:docker .
|
|
|
|
- name: Compile website translations
|
|
id: compile_translations
|
|
run: |
|
|
npx nx run twenty-website:lingui:compile
|
|
git status
|
|
git add packages/twenty-website/src/locales
|
|
if ! git diff --staged --quiet --exit-code; then
|
|
git commit -m "chore: compile website translations"
|
|
echo "changes_detected=true" >> $GITHUB_OUTPUT
|
|
else
|
|
echo "changes_detected=false" >> $GITHUB_OUTPUT
|
|
fi
|
|
|
|
- name: Push changes
|
|
if: steps.compile_translations.outputs.changes_detected == 'true'
|
|
run: git push origin HEAD:i18n-website
|
|
|
|
- name: Create pull request
|
|
if: steps.compile_translations.outputs.changes_detected == 'true'
|
|
run: |
|
|
if git diff --name-only origin/main..HEAD | grep -q .; then
|
|
gh pr create -B main -H i18n-website --title 'i18n - website translations' --body 'Created by Github action' || true
|
|
else
|
|
echo "No file differences between branches, skipping PR creation"
|
|
fi
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Trigger i18n automerge
|
|
if: steps.compile_translations.outputs.changes_detected == 'true'
|
|
env:
|
|
GH_TOKEN: ${{ secrets.TWENTY_INFRA_TOKEN }}
|
|
run: |
|
|
gh api repos/twentyhq/twenty-infra/dispatches -f event_type=i18n-pr-ready
|