.github/workflows/compile-pdf.yml

44 lines · 1451 bytes

 1# Generates and saved a PDF document from the main markdown file
 2# Easier to read on certain devices, or for users with accesibility needs
 3
 4name: 📁 Compile PDF Document
 5on:
 6  workflow_dispatch: # Manual dispatch
 7  schedule:
 8    - cron: '0 5 * * 6' # Every Saturday morning.
 9jobs:
10  # Job #1 - Generate an embedded SVG asset, showing all contributors
11  compile-pdf:
12    runs-on: ubuntu-latest
13    steps:
14      - name: Checkout 🛎️
15        uses: actions/checkout@v2
16      - name: Make PDF 📄
17        uses: baileyjm02/markdown-to-pdf@v1.1.0
18        with:
19          input_dir: .
20          output_dir: .github/assets/
21          build_pdf: true
22          build_html: false
23          table_of_contents: false
24      - name: Upload Artifact 📤
25        uses: actions/upload-artifact@v3
26        with:
27          name: awesome-privacy-pdf
28          path: .github/assets/README.pdf
29      - name: Commit file ✅
30        run: |
31          git config --local user.email "alicia-gh-bot@mail.as93.net"
32          git config --local user.name "liss-bot"
33          git add .github/assets/*.pdf
34          if ! git diff-index --quiet HEAD; then
35            git commit -m "Generate PDF file"
36          else
37            echo "Nothing to do"
38          fi
39      - name: Push changes ➡️
40        uses: ad-m/github-push-action@master
41        with:
42          github_token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
43          branch: ${{ github.ref }}
44