diff --git a/.github/workflows/generate-pdfs.yml b/.github/workflows/generate-pdfs.yml index 2b547743..049e9fde 100644 --- a/.github/workflows/generate-pdfs.yml +++ b/.github/workflows/generate-pdfs.yml @@ -1,9 +1,8 @@ name: Generate PDFs on: - push: - branches: - - main + schedule: + - cron: "15 0 * * *" # Run daily at 00.15 workflow_dispatch: jobs: @@ -11,13 +10,33 @@ jobs: runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v2 - - - uses: docker://pandoc/latex:2.9 + - name: Checkout + uses: actions/checkout@v2 + with: + ref: ${{ github.ref }} + + - name: Get current branch + run: | + # Get the current branch and output as environment variable + GITHUB_BRANCH=$( echo "${{ github.ref }}" | sed 's/refs\/heads\///g' ) + echo "GITHUB_BRANCH=$GITHUB_BRANCH" >> $GITHUB_ENV + + - name: Generate PDFs + uses: docker://pandoc/latex:2.9 with: - args: ${{ github.action_path }}/pdf-gen/gen-pdfs.sh + entrypoint: pdf-gen/gen-pdfs.sh - - uses: actions/upload-artifact@master + - name: Upload artifacts + uses: actions/upload-artifact@master with: - name: output - path: docs/pdfs/ + name: pdf-artifacts + path: docs/pdfs/*.pdf + + - name: Update PDFs on repo + uses: test-room-7/action-update-file@v1 + with: + branch: ${{ env.GITHUB_BRANCH }} + file-path: docs/pdfs/*.pdf + commit-msg: Update PDFs + github-token: ${{ secrets.GITHUB_TOKEN }} + diff --git a/docs/pdfs/indoor-overview.pdf b/docs/pdfs/indoor-overview.pdf new file mode 100644 index 00000000..27f37a0b Binary files /dev/null and b/docs/pdfs/indoor-overview.pdf differ diff --git a/docs/pdfs/indoor-quick-start.pdf b/docs/pdfs/indoor-quick-start.pdf new file mode 100644 index 00000000..a7e74c54 Binary files /dev/null and b/docs/pdfs/indoor-quick-start.pdf differ diff --git a/docs/pdfs/outdoor-overview.pdf b/docs/pdfs/outdoor-overview.pdf new file mode 100644 index 00000000..c654ae5f Binary files /dev/null and b/docs/pdfs/outdoor-overview.pdf differ diff --git a/docs/pdfs/outdoor-quick-start.pdf b/docs/pdfs/outdoor-quick-start.pdf new file mode 100644 index 00000000..b5891a94 Binary files /dev/null and b/docs/pdfs/outdoor-quick-start.pdf differ diff --git a/pdf-gen/gen-pdfs.sh b/pdf-gen/gen-pdfs.sh index e85ae9a9..bd43a2d6 100755 --- a/pdf-gen/gen-pdfs.sh +++ b/pdf-gen/gen-pdfs.sh @@ -1,6 +1,6 @@ #!/bin/sh -pandoc pdf-data.yml ../docs/indoor-hotspot/overview.md -o ../docs/pdfs/indoor-overview.pdf --pdf-engine=xelatex --resource-path ../docs/media/ -pandoc pdf-data.yml ../docs/indoor-hotspot/quick-start.md -o ../docs/pdfs/indoor-quick-start.pdf --pdf-engine=xelatex --resource-path ../docs/media/ -pandoc pdf-data.yml ../docs/outdoor-hotspot/overview.md -o ../docs/pdfs/outdoor-overview.pdf --pdf-engine=xelatex --resource-path ../docs/media/ -pandoc pdf-data.yml ../docs/outdoor-hotspot/quick-start.md -o ../docs/pdfs/outdoor-quick-start.pdf --pdf-engine=xelatex --resource-path ../docs/media/ +pandoc pdf-gen/pdf-data.yml docs/indoor-hotspot/overview.md -o docs/pdfs/indoor-overview.pdf --pdf-engine=xelatex --resource-path docs/media/ +pandoc pdf-gen/pdf-data.yml docs/indoor-hotspot/quick-start.md -o docs/pdfs/indoor-quick-start.pdf --pdf-engine=xelatex --resource-path docs/media/ +pandoc pdf-gen/pdf-data.yml docs/outdoor-hotspot/overview.md -o docs/pdfs/outdoor-overview.pdf --pdf-engine=xelatex --resource-path docs/media/ +pandoc pdf-gen/pdf-data.yml docs/outdoor-hotspot/quick-start.md -o docs/pdfs/outdoor-quick-start.pdf --pdf-engine=xelatex --resource-path docs/media/ diff --git a/pdf-gen/pdf-data.yml b/pdf-gen/pdf-data.yml index c5d28c11..5f615826 100755 --- a/pdf-gen/pdf-data.yml +++ b/pdf-gen/pdf-data.yml @@ -5,16 +5,18 @@ header-includes: \usepackage{fancyhdr} \pagestyle{fancy} \setlength\headheight{28pt} - \fancyhead[L]{\includegraphics[width=5cm]{../docs/media/Nebra.png}} + \fancyhead[L]{\includegraphics[width=5cm]{docs/media/Nebra.png}} \fancyfoot[LE,RO]{Nebra LTD. 2021} fontsize: 14pt mainfont: Ubuntu-Regular.ttf mainfontoptions: +- Path=pdf-gen/ - BoldFont=Ubuntu-Bold.ttf - ItalicFont=Ubuntu-Italic.ttf - BoldItalicFont=Ubuntu-BoldItalic.ttf monofont: UbuntuMono-Regular.ttf monofontoptions: +- Path=pdf-gen/ - BoldFont=UbuntuMono-Bold.ttf - ItalicFont=UbuntuMono-Italic.ttf - BoldItalicFont=UbuntuMono-BoldItalic.ttf