WORKFLOW: build PDF #83
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: Pages | |
on: | |
push: | |
branch: | |
- master | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo | |
- name: Update modification date and commit info | |
run: make modify-date | |
- name: Build and Commit | |
uses: sphinx-notes/pages@master | |
with: | |
extra_files: | | |
LICENSE | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: gh-pages | |
build-pdf: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: check out code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo | |
- name: install python3 | |
run: | | |
sudo apt -y update | |
sudo apt -y install python3 python3-pip | |
- name: install python3 dependencies | |
run: | | |
python3 -m pip install -r requirements.txt | |
- name: install latex dependencies | |
run: | | |
sudo apt install -y latexmk texlive texlive-fonts-extra | |
- name: build PDF | |
run: make latexpdf | |
- name: do some trick ;-) | |
run: | | |
mv _build/latex/matematyka.pdf .. | |
git rm -rf * | |
mv ../matematyka.pdf . | |
git add . | |
git commit --amend --no-edit | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: pdf |