aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/build-pdf.yml68
1 files changed, 68 insertions, 0 deletions
diff --git a/.github/workflows/build-pdf.yml b/.github/workflows/build-pdf.yml
new file mode 100644
index 0000000..08149eb
--- /dev/null
+++ b/.github/workflows/build-pdf.yml
@@ -0,0 +1,68 @@
+name: build-pdf
+on:
+ push:
+ branches:
+ - master
+ paths-ignore:
+ - '**build-pdf.yml'
+ pull_request:
+ branches:
+ - master
+ types:
+ - closed
+ paths-ignore:
+ - '**build-pdf.yml'
+ workflow_dispatch:
+
+jobs:
+ build:
+ if: github.event.pull_request.merged == true || github.event_name != 'pull_request'
+ runs-on: ubuntu-latest
+ steps:
+ # Checks-out the master branch of this repository
+ - uses: actions/checkout@v3
+ with:
+ ref: master
+ path: master
+
+ # Checks-out the gh-pages branch of this repository
+ - uses: actions/checkout@v3
+ with:
+ ref: gh-pages
+ path: gh-pages
+
+ # Build vc.tex
+ - name: build-vc
+ run: |
+ echo "%%% This file is generated by Makefile." > vc.tex
+ echo "%%% Do not edit this file!" >> vc.tex
+ echo "" >> vc.tex
+ git log -1 --format="format:\
+ \\gdef\\GITAbrHash{%h}\
+ \\gdef\\GITAuthorDate{%ad}\
+ \\gdef\\GITAuthorName{%an}" >> vc.tex
+ working-directory: master
+
+ # Build mmbtools.pdf
+ - name: build-pdf
+ uses: xu-cheng/latex-action@v2
+ with:
+ working_directory: master
+ root_file: mmbtools.tex
+ post_compile: mv mmbtools.pdf ../gh-pages
+
+ # Commit mmbtools.pdf
+ - name: commit-pdf
+ run: |
+ git config user.name github-actions
+ git config user.email github-actions@github.com
+ git add -f mmbtools.pdf
+ git commit -m "generated"
+ working-directory: gh-pages
+
+ - name: push-pdf
+ uses: ad-m/github-push-action@master
+ with:
+ directory: gh-pages
+ branch: gh-pages
+