Skip to content
This repository has been archived by the owner on Feb 22, 2024. It is now read-only.

New Crowdin updates #6915

New Crowdin updates

New Crowdin updates #6915

name: Staging translated Qiskit Applications docs
on:
pull_request:
branches: [ main ]
label:
types: [ gh-pages-apps ]
jobs:
build_docs:
runs-on: ubuntu-latest
if: contains( github.event.pull_request.labels.*.name, 'gh-pages-apps' )
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
############################ OPTIMIZATION #########################
- name: Install Optimization dependencies
run: |
cd optimization
python -m pip install --upgrade pip
pip install -U virtualenv setuptools wheel
pip install -e .
pip install jupyter sphinx_rtd_theme 'matplotlib<3.3.0' qiskit-terra[visualization] 'torchvision<0.10.0'
sudo apt-get install -y pandoc graphviz
pip install -U -r requirements-dev.txt -r requirements.txt sphinx-intl
- name: Build translated Qiskit Optimization Docs
env:
TRANSLATION_LANG: ${{ matrix.language }}
run: |
cd optimization
../tools/staging_optimization_translated_documentation.sh
- name: Compress artifact (Optimization)
run: |
mkdir -p artifacts/gh-pages
mkdir gh-pages && cd optimization && tar -zcvf ../gh-pages/optimization_docs_${{matrix.language}}.tar.gz optimization && cd ..
echo "listing the dir: "
ls
cp -R gh-pages/. artifacts/gh-pages/.
####################################################################
######################### MACHINE LEARNING #########################
- name: Install ML dependencies
run: |
cd machine-learning
python -m pip install --upgrade pip
pip install -U virtualenv setuptools wheel
pip install -e .
pip install jupyter sphinx_rtd_theme 'matplotlib<3.3.0' qiskit-terra[visualization] 'torchvision<0.10.0'
sudo apt-get install -y pandoc graphviz
pip install -U -r requirements-dev.txt -r requirements.txt sphinx-intl
- name: Build translated Qiskit ML Docs
env:
TRANSLATION_LANG: ${{ matrix.language }}
run: |
cd machine-learning
../tools/staging_ML_translated_documentation.sh
- name: Compress artifact (ML)
run: |
cd machine-learning && tar -zcvf ../gh-pages/ml_docs_${{matrix.language}}.tar.gz machine-learning && cd ..
cp -R gh-pages/. artifacts/gh-pages/.
####################################################################
############################# FINANCE ##############################
- name: Install Finance dependencies
run: |
cd finance
python -m pip install --upgrade pip
pip install -U virtualenv setuptools wheel
pip install -e .
pip install jupyter sphinx_rtd_theme 'matplotlib<3.3.0' qiskit-terra[visualization] 'torchvision<0.10.0'
sudo apt-get install -y pandoc graphviz
pip install -U -r requirements-dev.txt -r requirements.txt sphinx-intl
- name: Build translated Qiskit Finance Docs
env:
TRANSLATION_LANG: ${{ matrix.language }}
run: |
cd finance
../tools/staging_finance_translated_documentation.sh
- name: Compress artifact (Finance)
run: |
cd finance && tar -zcvf ../gh-pages/finance_docs_${{matrix.language}}.tar.gz finance && cd ..
cp -R gh-pages/. artifacts/gh-pages/.
####################################################################
############################### NATURE #############################
- name: Install Nature dependencies
run: |
cd nature
python -m pip install --upgrade pip
pip install -U virtualenv setuptools wheel
pip install -e .
pip install jupyter sphinx_rtd_theme 'matplotlib<3.3.0' qiskit-terra[visualization] 'torchvision<0.10.0'
sudo apt-get install -y pandoc
pip install -e .[pyscf,mpl,sparse]
pip install -U -c constraints.txt -r requirements-dev.txt
- name: Build translated Qiskit Nature Docs
env:
TRANSLATION_LANG: ${{ matrix.language }}
run: |
cd nature
../tools/staging_nature_translated_documentation.sh
- name: Compress artifact (Nature)
run: |
cd nature && tar -zcvf ../gh-pages/nature_docs_${{matrix.language}}.tar.gz nature && cd ..
cp -R gh-pages/. artifacts/gh-pages/.
####################################################################
- name: Upload all artifacts
uses: actions/upload-artifact@main
with:
name: qiskit-translated-docs
path: artifacts
strategy:
matrix:
language:
- bn_BN
# - de_DE
- es_UN
- fr_FR
- hi_IN
- ja_JP
- ko_KR
# - mr_IN
# - pl_PL
- pt_UN
# - ru_RU
- ta_IN
# - th_TH
- tr_TR
- zh_CN
- zh_TW
deploy_docs:
runs-on: ubuntu-latest
needs: build_docs
steps:
- uses: actions/checkout@main
- name: Download artifact
uses: actions/download-artifact@v2
with:
name: qiskit-translated-docs
- name: Decompress artifact
run: |
for f in gh-pages/*.tar.gz; do tar -zxvf "$f" --directory gh-pages; done
rm -r gh-pages/*.tar.gz
- name: Pushes to another repository
uses: cpina/github-action-push-to-another-repository@main
env:
API_TOKEN_GITHUB: ${{ secrets.STAGING_REPO }}
with:
source-directory: './gh-pages'
destination-github-username: 'qiskit-community'
destination-repository-name: 'qiskit-translations-staging'
target-directory: 'apps'
user-name: SooluThomas
user-email: 11485594+SooluThomas@users.noreply.github.com
target-branch: main
commit-message: Qiskit Autodeploy ORIGIN_COMMIT from $GITHUB_REF