Move SC02 to edit folder (#751) #1708
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: Generate PDFs | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| paths: | |
| - 'th/**/*.md' | |
| - 'th/**/*.yaml' | |
| # - 'lo/**/*.md' (commented out until needed) | |
| - '.tooling' | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| defaults: | |
| run: | |
| shell: bash | |
| jobs: | |
| changes: | |
| runs-on: ubuntu-latest | |
| # Required permissions | |
| permissions: | |
| pull-requests: read | |
| outputs: | |
| # Expose matched filters as job 'books' output variable | |
| books: ${{ steps.filter.outputs.changes }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dorny/paths-filter@v3 | |
| id: filter | |
| with: | |
| filters: | | |
| th/MB: | |
| - 'th/MB/**' | |
| - .tooling | |
| th/LBF: | |
| - 'th/LBF/**' | |
| - .tooling | |
| generate-pdfs: | |
| needs: changes | |
| strategy: | |
| matrix: | |
| book: ${{ fromJSON(github.ref == 'refs/heads/main' && '["th/LBF", "th/MB"]' || needs.changes.outputs.books) }} | |
| runs-on: ubuntu-latest | |
| container: | |
| image: mattleff/xelatex-swath | |
| options: --user 1001 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # This is required for retrieving the content last modified timestamps | |
| submodules: 'recursive' | |
| - name: Run Make | |
| working-directory: ./.tooling/latex/ | |
| run: make -j 4 pdfs/${{ matrix.book }} | |
| # Dynamically set the name for the artifact based on the current time and build scope | |
| - name: Set Env | |
| run: | | |
| echo "CURRENT_TIME=$(date +'%Y-%m-%d_%H.%M.%S')" >> $GITHUB_ENV | |
| BOOK_NAME=${{ matrix.book }} | |
| echo "BOOK_NAME=$(echo $BOOK_NAME | sed 's/\//-/g')" >> $GITHUB_ENV | |
| - name: Upload built docs | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ env.BOOK_NAME }}_${{ env.CURRENT_TIME }} | |
| path: .tooling/latex/draft/${{ matrix.book }} |