added md presentation (#22) #39
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Lint and Release Book | |
| on: | |
| push: | |
| branches: [master] | |
| tags: ['v*'] | |
| pull_request: | |
| branches: [master] | |
| jobs: | |
| lint-and-fix: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write # Required for GITHUB_TOKEN to push lint fixes back | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node & Lint | |
| run: | | |
| npm ci || npm install markdownlint-cli | |
| npx markdownlint --fix "**/*.md" | |
| - name: Commit Lint Fixes | |
| run: | | |
| git config --local user.email "kangs2000@gmail.com" | |
| git config --local user.name "Kangeyan Passoubady" | |
| git add . | |
| # Only push if there are actual changes from linting | |
| git diff --quiet && git diff --staged --quiet || (git commit -m "fix: markdown linting" && git push) | |
| build-and-release: | |
| needs: lint-and-fix | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python 3.10 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.10' | |
| - name: Install System Deps & Bookbuilder | |
| run: | | |
| # System libraries required for WeasyPrint (PDF) and pandoc (epub/docx) | |
| # fonts-noto-* provide Tamil Unicode coverage for WeasyPrint PDF rendering | |
| sudo apt-get update && sudo apt-get install -y \ | |
| libpango-1.0-0 libharfbuzz0b libpangoft2-1.0-0 pandoc \ | |
| fonts-noto-core fonts-noto-extra \ | |
| fonts-lohit-taml | |
| fc-cache -fv | |
| python -m pip install --upgrade pip | |
| pip install weasyprint>=68.1 | |
| # Use your manually created secret for the private repo | |
| pip install git+https://${{ secrets.MY_BOOK_BUILDER_PAT }}@github.com/kpassoubady/bookbuilder.git@main | |
| - name: Build Books | |
| run: | | |
| bookbuilder build --root . --order configs/tamil-prompt-engineering-book-show-case.json --format=pdf | |
| bookbuilder build --root . --order configs/tamil-prompt-engineering-book-show-case.json --format=epub | |
| bookbuilder build --root . --order configs/tamil-prompt-engineering-book-show-case.json --format=docx | |
| - name: Upload to GitHub Release | |
| if: startsWith(github.ref, 'refs/tags/v') # Only attach artifacts for version tags | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: | | |
| bookbuilder-output/*.pdf | |
| bookbuilder-output/*.epub | |
| bookbuilder-output/*.docx | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |