From e1fa83fa8c7f603819849035fc285b51d886da6e Mon Sep 17 00:00:00 2001 From: lifehackerhansol Date: Wed, 24 Apr 2024 00:23:30 -0700 Subject: [PATCH] workflow: add automation of uploading source text to Crowdin This will push to Crowdin if a push to main branch was successful. This allows automation of syncing source text, making it less of a hassle to synchronize all translations. --- .github/workflows/crowdin-upload.yml | 39 ++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/crowdin-upload.yml diff --git a/.github/workflows/crowdin-upload.yml b/.github/workflows/crowdin-upload.yml new file mode 100644 index 0000000000000..514b9a8f17808 --- /dev/null +++ b/.github/workflows/crowdin-upload.yml @@ -0,0 +1,39 @@ +name: Upload source files to Crowdin + +on: + push: + branches: [ master ] + paths: + - 'docs/**.md' + - 'docs/_include/**.md' + - 'docs/.vitepress/i18n/strings/en_US.json' + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + persist-credentials: false + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + + - name: Install dependencies + run: npm ci + + # This makes sure that the site actually builds before pushing to Crowdin + - name: Build site + run: npm run docs:build + + - name: Push to Crowdin + uses: crowdin/github-action@v2 + with: + upload_sources: true + env: + CROWDIN_TOKEN: ${{ secrets.CROWDIN_TOKEN }}