enter wiki to commit #16
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Export wiki to pdf | |
on: | |
push: | |
branches: | |
- export_pdf | |
jobs: | |
job1: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.11"] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: Checkout wiki | |
uses: actions/checkout@v4 | |
with: | |
repository: DoctorReid/StarRailAutoProxy.wiki | |
ref: master | |
fetch-depth: 1 | |
path: wiki | |
- name: Install pandoc | |
run: sudo apt-get install -y pandoc | |
- name: Install TeX Live | |
run: sudo apt-get install -y texlive-xetex | |
- name: Install Noto Font | |
run: sudo apt-get install -y fonts-noto | |
- name: Convert Markdown to PDF | |
run: | | |
cd wiki | |
if [ ! -d "output" ]; then | |
mkdir output | |
fi | |
pandoc Home.md -o output/output.pdf --pdf-engine=xelatex --variable mainfont="Noto Sans" --variable sansfont="Noto Sans" | |
- name: Commit changes | |
run: | | |
cd wiki | |
if ! git diff --quiet; then | |
git config user.name github-actions | |
git config user.email github-actions@github.com | |
git add data/locales/**/*.mo | |
git commit -m "#126 自动转化wiki成pdf提交 $(date +%Y-%m-%d)" | |
git push | |
else | |
echo "No file modifications" | |
fi |