-
Notifications
You must be signed in to change notification settings - Fork 0
92 lines (92 loc) · 3.03 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: pyvista-doc-tutorial-update
on:
schedule:
- cron: "0 1 * * *"
push:
branches:
- main
pull_request:
branches:
- main
jobs:
script:
runs-on: ubuntu-20.04
steps:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Get Job URL
uses: Tiryoh/gha-jobid-action@v1
id: jobs
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
job_name: script
- name: Checkout with submodule
uses: actions/checkout@v4
with:
fetch-depth: 0
repository: pyvista/pyvista-tutorial-translations
submodules: true
path: pyvista-tutorial-translations
- name: Checkout other repo
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: "gh-pages"
path: pyvista-tutorial-ja
- name: Setup SSH
uses: MrSquaare/ssh-setup-action@v3
with:
host: github.com
private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: install
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends python3-setuptools
sudo apt-get install -y --no-install-recommends libgl1-mesa-dev xvfb ffmpeg
sudo apt-get install -y --no-install-recommends python3-venv
sudo apt-get install -y --no-install-recommends libgl1-mesa-glx
sudo apt-get install -y --no-install-recommends python3-tk pandoc
sudo apt-get install -y --no-install-recommends libgeos-dev
pip install -U pip setuptools wheel
cd pyvista-tutorial-translations
git submodule update --remote
pip install -r ./requirements.txt
pip install -r pyvista-tutorial/requirements_docs.txt
cd ../
- name: build
env:
JOB_ID: ${{ steps.jobs.outputs.job_id }}
HTML_URL: ${{ steps.jobs.outputs.html_url }}
run: |
cd pyvista-tutorial-translations
set -x
export DISPLAY=:99.0
export PYVISTA_OFF_SCREEN=True
Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
sleep 3
set +x
git submodule update --remote
cd pyvista-tutorial
make -C doc html SPHINXOPTS="-w build_errors.txt -N -D language=ja -D locale_dirs='../../../locale'"
cd ../
cd ../
- name: commit
if: contains(github.ref, 'main')
env:
JOB_ID: ${{ steps.jobs.outputs.job_id }}
HTML_URL: ${{ steps.jobs.outputs.html_url }}
run: |
cd pyvista-tutorial-ja
git checkout gh-pages
git rm -rf *
mv ../pyvista-tutorial-translations/pyvista-tutorial/doc/build/html/* .
touch .nojekyll
git config --global user.email $GITHUB_REPOSITORY
git config --global user.name $GITHUB_REPOSITORY
git add .
git commit --allow-empty -m "[ci skip] $JOB_ID
$HTML_URL"
git push origin gh-pages
cd ../