155 lines
4.8 KiB
YAML
155 lines
4.8 KiB
YAML
name: Crowdin Docs Download
|
|
on:
|
|
workflow_dispatch:
|
|
schedule:
|
|
# runs every day at 12:00 noon UTC
|
|
- cron: '0 12 * * *'
|
|
|
|
jobs:
|
|
i18n-download-docs-translations:
|
|
name: Docs
|
|
runs-on: ubuntu-18.04
|
|
|
|
steps:
|
|
- name: Checkout Source Files
|
|
uses: actions/checkout@v2
|
|
with:
|
|
token: ${{ secrets.CROWDIN_CAMPERBOT_PAT }}
|
|
|
|
- name: Install Dependencies
|
|
working-directory: ./tools
|
|
run: |
|
|
cd ./crowdin
|
|
npm ci
|
|
|
|
##### Download Chinese #####
|
|
- name: Crowdin Download Chinese Translations
|
|
uses: crowdin/github-action@master
|
|
# options: https://github.com/crowdin/github-action/blob/master/action.yml
|
|
with:
|
|
# uploads
|
|
upload_sources: false
|
|
upload_translations: false
|
|
auto_approve_imported: false
|
|
import_eq_suggestions: false
|
|
|
|
# downloads
|
|
download_translations: true
|
|
download_language: zh-CN
|
|
skip_untranslated_files: false
|
|
export_only_approved: true
|
|
|
|
push_translations: false
|
|
|
|
# pull-request
|
|
create_pull_request: false
|
|
|
|
# global options
|
|
config: './config/crowdin/docs/crowdin.yml'
|
|
base_url: ${{ secrets.CROWDIN_BASE_URL_FCC }}
|
|
|
|
# Uncomment below to debug
|
|
# dryrun_action: true
|
|
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.CROWDIN_CAMPERBOT_PAT }}
|
|
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID_DOCS }}
|
|
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_CAMPERBOT_SERVICE_TOKEN }}
|
|
|
|
# Convert Simplified Chinese to Traditional #
|
|
- name: Generate Translations
|
|
uses: ./tools/crowdin/actions/convert-chinese
|
|
|
|
##### Download Portuguese#####
|
|
- name: Crowdin Download Portuguese Translations
|
|
uses: crowdin/github-action@master
|
|
# options: https://github.com/crowdin/github-action/blob/master/action.yml
|
|
with:
|
|
# uploads
|
|
upload_sources: false
|
|
upload_translations: false
|
|
auto_approve_imported: false
|
|
import_eq_suggestions: false
|
|
|
|
# downloads
|
|
download_translations: true
|
|
download_language: pt-BR
|
|
skip_untranslated_files: false
|
|
export_only_approved: true
|
|
|
|
push_translations: false
|
|
|
|
# pull-request
|
|
create_pull_request: false
|
|
|
|
# global options
|
|
config: './config/crowdin/docs/crowdin.yml'
|
|
base_url: ${{ secrets.CROWDIN_BASE_URL_FCC }}
|
|
|
|
# Uncomment below to debug
|
|
# dryrun_action: true
|
|
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.CROWDIN_CAMPERBOT_PAT }}
|
|
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID_DOCS }}
|
|
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_CAMPERBOT_SERVICE_TOKEN }}
|
|
|
|
##### Download Espanol #####
|
|
- name: Crowdin Espanol Download Translations
|
|
uses: crowdin/github-action@master
|
|
# options: https://github.com/crowdin/github-action/blob/master/action.yml
|
|
with:
|
|
# uploads
|
|
upload_sources: false
|
|
upload_translations: false
|
|
auto_approve_imported: false
|
|
import_eq_suggestions: false
|
|
|
|
# downloads
|
|
download_translations: true
|
|
download_language: es-EM
|
|
skip_untranslated_files: false
|
|
export_only_approved: true
|
|
|
|
push_translations: false
|
|
|
|
# pull-request
|
|
create_pull_request: false
|
|
|
|
# global options
|
|
config: './config/crowdin/docs/crowdin.yml'
|
|
base_url: ${{ secrets.CROWDIN_BASE_URL_FCC }}
|
|
|
|
# Uncomment below to debug
|
|
# dryrun_action: true
|
|
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID_DOCS }}
|
|
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_CAMPERBOT_SERVICE_TOKEN }}
|
|
|
|
# Create Commit
|
|
- name: Commit Changes
|
|
env:
|
|
EMAIL: ${{ secrets.ACTIONS_CAMPERBOT_EMAIL }}
|
|
run: |
|
|
git checkout -b i18n-sync-docs
|
|
git config --global user.name "camperbot"
|
|
git config --global user.email "$EMAIL"
|
|
git add .
|
|
git diff-index --quiet HEAD || git commit -m "chore(i18n,docs): update translations"
|
|
git push -u origin i18n-sync-docs -f
|
|
|
|
# Generate PR - all languages should go ABOVE this. #
|
|
- name: Create PR
|
|
uses: ./tools/crowdin/actions/pr-creator
|
|
with:
|
|
github-token: ${{ secrets.CROWDIN_CAMPERBOT_PAT }}
|
|
branch: 'i18n-sync-docs'
|
|
owner-repo: 'freeCodeCamp/freeCodeCamp'
|
|
base: 'main'
|
|
title: 'chore(i18n,docs): processed translations'
|
|
body: 'This PR was opened auto-magically by Crowdin.'
|
|
labels: 'crowdin-sync'
|
|
team_reviewers: 'i18n'
|