From 282f850e167f9fb433211ff93a895ac04f306279 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 | 32 ++++++++++++++++++++++++++++ 1 file changed, 32 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 00000000..78d75bf8 --- /dev/null +++ b/.github/workflows/crowdin-upload.yml @@ -0,0 +1,32 @@ +name: Upload source files to Crowdin + +on: + push: + branches: [ main ] + paths: + - 'pages/en_US/**.md' + - '_data/en-US/**.json' + - 'assets/js/i18n/en-US.js' + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + persist-credentials: false + + - uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.2' + bundler-cache: true + + # Build the site using Jekyll + # No point pushing to Crowdin if the site build is failing + - name: Test site build via Jekyll + run: JEKYLL_ENV=production bundle exec jekyll build + + - name: Push to Crowdin + run: CROWDIN_TOKEN=${{ secrets.CROWDIN_TOKEN }} crowdin upload sources