github action, add to gitignore

This commit is contained in:
thomas.ekstrand 2024-02-24 15:27:58 -06:00
parent dc91b0678a
commit bfda6f9320
3 changed files with 37 additions and 2 deletions

34
.github/workflows/pdf.yml vendored Normal file
View file

@ -0,0 +1,34 @@
name: Generate Documentation PDF
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Install Prince
run: |
curl https://www.princexml.com/download/prince-14.2-linux-generic-x86_64.tar.gz -O
tar zxf prince-14.2-linux-generic-x86_64.tar.gz
cd prince-14.2-linux-generic-x86_64
yes "" | sudo ./install.sh
- name: Build PDF
run: npx docusaurus-prince-pdf -u https://meshtastic.org/docs/about/ --dest ./pdf --output ./pdf/Meshtastic-Documentation.pdf
- name: Fetch GitHub App Installation Access Token
id: generate_token
uses: tibdex/github-app-token@v2
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
- name: Commit and push PDF to the artifacts repository
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "GitHub Actions Bot"
git clone --single-branch -b docs https://github.com/meshtastic/artifacts.git --depth=1
DATE_TIME=$(date +'%Y-%m-%d_%H-%M-%S')
mv ./pdf/Meshtastic-Documentation.pdf ./artifacts/Meshtastic-Documentation-${DATE_TIME}_${{ github.sha }}.pdf
cd artifacts
git add .
git commit -m "Auto generated PDF documentation ${DATE_TIME}"
git push --set-upstream https://x-access-token:${{ steps.generate_token.outputs.token }}@github.com/meshtastic/artifacts.git docs

1
.gitignore vendored
View file

@ -6,6 +6,7 @@ build
.vercel .vercel
.env .env
.pnpm-debug.log .pnpm-debug.log
static/documents/pdf
# macOS # macOS
.DS_Store .DS_Store

View file

@ -10,7 +10,7 @@
"swizzle": "docusaurus swizzle", "swizzle": "docusaurus swizzle",
"serve": "docusaurus serve", "serve": "docusaurus serve",
"clear": "docusaurus clear", "clear": "docusaurus clear",
"pdf": "pnpm docusaurus-prince-pdf -u http://localhost:3000/docs/about/ --dest ./static/documents/pdf --output ./static/documents/pdf/Meshtastic-Documentation.pdf" "pdf": "npm docusaurus-prince-pdf -u https://meshtastic.org/docs/about/ --dest ./static/documents/pdf --output ./static/documents/pdf/Meshtastic-Documentation.pdf"
}, },
"dependencies": { "dependencies": {
"@algolia/client-search": "^4.22.1", "@algolia/client-search": "^4.22.1",