meshtastic/.github/workflows/pdf.yml

37 lines
1.2 KiB
YAML
Raw Normal View History

2024-02-24 13:27:58 -08:00
name: Generate Documentation PDF
on:
2024-02-29 18:04:51 -08:00
pull_request:
types:
- closed
2024-02-24 17:11:38 -08:00
2024-02-24 13:27:58 -08:00
jobs:
build:
runs-on: ubuntu-latest
steps:
2024-02-24 17:11:38 -08:00
- name: Get filename with date and sha
run: |
DATE_TIME=$(date +'%Y-%m-%d_%H-%M')
echo "filename=Meshtastic-Documentation-${DATE_TIME}-${{ github.sha }}.pdf" >> $GITHUB_OUTPUT
id: filename
2024-02-24 13:27:58 -08:00
- name: Install Prince
run: |
curl https://www.princexml.com/download/prince-15.3-linux-generic-x86_64.tar.gz -O
tar zxf prince-15.3-linux-generic-x86_64.tar.gz
cd prince-15.3-linux-generic-x86_64
2024-02-24 13:27:58 -08:00
yes "" | sudo ./install.sh
- name: Build PDF
2024-02-29 15:51:43 -08:00
run: npx docusaurus-prince-pdf -u https://meshtastic.org/docs/about/ --dest ./ --output ./${{ steps.filename.outputs.filename }}
2024-02-24 13:27:58 -08:00
2024-02-24 17:11:38 -08:00
- name: Create request artifacts
2024-02-29 16:19:41 -08:00
if: github.event.pull_request.merged
2024-02-24 17:11:38 -08:00
uses: gavv/pull-request-artifacts@v2.1.0
2024-02-24 13:27:58 -08:00
with:
2024-02-24 17:11:38 -08:00
commit: ${{ (github.event.pull_request_target || github.event.pull_request).head.sha }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
artifacts-token: ${{ secrets.ARTIFACTS_TOKEN }}
artifacts-repo: meshtastic/artifacts
artifacts-branch: docs
2024-02-29 15:51:43 -08:00
artifacts: ./${{ steps.filename.outputs.filename }}