aboutsummaryrefslogtreecommitdiffstats
path: root/.github/workflows/build-pdf.yml
blob: 036a55c6925dd461b9b93bb3b4da2897d582cecb (plain)
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
name: build-pdf
on:
  push:
    branches:
      - 'master'
    paths-ignore:
      - 'README.md'
      - 'Makefile'
      - 'LICENSE.txt'
  workflow_dispatch:

jobs:
  build:
    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 "Open Digital Radio"
          git config user.email github@opendigitalradio.org
          git add -f mmbtools.pdf
          git commit -m "generated by github action build-pdf"
        working-directory: gh-pages

      - name: push-pdf
        uses: ad-m/github-push-action@master
        with:
          directory: gh-pages
          branch: gh-pages