Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upload doc pdf to huggingface #644

Merged
merged 2 commits into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 35 additions & 10 deletions .github/workflows/build-doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -196,15 +196,13 @@ jobs:
popd
git diff

if true; then
make latex >/dev/null 2>&1
mkdir -pv build/html/_static

cd build/latex
latexmk -interaction=nonstopmode -f -pdf -dvi- -ps- sherpa.tex >/dev/null 2>&1 || true
ls -lh sherpa.pdf
cp -v sherpa.pdf ../html/
fi
make latex
mkdir -pv build/html/_static
cd build/latex
#latexmk -interaction=nonstopmode -f -pdf -dvi- -ps- sherpa.tex || true
latexmk -interaction=nonstopmode -f -pdf -dvi- -ps- sherpa.tex >/dev/null 2>&1 || true
ls -lh sherpa.pdf
cp -v sherpa.pdf /workspace/

- name: View generated files
shell: bash
Expand All @@ -224,12 +222,39 @@ jobs:
with:
file_glob: true
overwrite: true
file: ./docs/build/html/sherpa.pdf
file: /workspace/sherpa.pdf
tag: doc

- name: Publish to huggingface
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
uses: nick-fields/retry@v3
with:
max_attempts: 20
timeout_seconds: 200
shell: bash
command: |
git config --global user.email "[email protected]"
git config --global user.name "Fangjun Kuang"

rm -rf huggingface
export GIT_LFS_SKIP_SMUDGE=1
export GIT_CLONE_PROTECTION_ACTIVE=false

git clone https://huggingface.co/csukuangfj/sherpa-doc huggingface
cd huggingface

cp -v ../sherpa.pdf ./
git status
git lfs track "*.pdf"
git add .
git commit -m "update doc"
git push https://csukuangfj:[email protected]/csukuangfj/sherpa-doc main

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/build/html
force_orphan: true
publish_branch: gh-pages
4 changes: 2 additions & 2 deletions docs/source/pdf.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ We provide a single pdf file containing all the documentation.

Please download it from the following address:

`<https://k2-fsa.github.io/sherpa/sherpa.pdf>`_
`<https://huggingface.co/csukuangfj/sherpa-doc/blob/main/sherpa.pdf>`_

.. note::

For Chinese users, you can use the following mirror:

`<https://hub.nuaa.cf/k2-fsa/sherpa/releases/download/doc/sherpa.pdf>`_
`<https://hf-mirror.com/csukuangfj/sherpa-doc/blob/main/sherpa.pdf>`_

Please always download the latest version.

Expand Down
Loading