Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix] textbook pdf missing in push #93

Merged
merged 14 commits into from
Sep 9, 2024
35 changes: 20 additions & 15 deletions .github/workflows/generate-pdf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -167,28 +167,33 @@ jobs:
run: |
rm -rf pdf_output
rm -rf pdf_numbering_output
rm -rf textbook_full_original.pdf
rm -rf textbook_full_cpy.pdf
rm textbook_full_original.pdf
rm textbook_full_cpy.pdf
rm numbering.pdf
rm numbering.aux

- name: Check if PDF files are created
run: |
if [ -f "textbook_full.pdf" ]; then echo "textbook_full.pdf here"; else echo "textbook_full.pdf gone"; fi

- name: Check git status
run: git status

- name: Check git diff
run: git diff --stat

- name: Commit changes to a new branch
if: github.event_name == 'push' && !contains(github.event.head_commit.message, 'Update PDF of textbook')
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "GitHub Actions"
git checkout -b update-textbook-full-pdf
git add textbook_full.pdf
git add -f textbook_full.pdf
git commit -m "Update PDF of textbook on site after a merge to main"
git push origin HEAD
git push -f origin update-textbook-full-pdf
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create a Pull Request
if: github.event_name == 'push' && !contains(github.event.head_commit.message, 'Update PDF of textbook')
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "Update PDF of textbook on site"
branch: update-textbook-full-pdf
title: "Update full PDF of textbook"
body: "This PR updates the full PDF of the textbook."
base: main
- name: Check git log on update-textbook-full-pdf branch
run: |
git checkout update-textbook-full-pdf
git log
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,6 @@ $RECYCLE.BIN/

# PDF Page Numbering
pdf-generation/numbering.aux
numbering.aux
numbering.pdf
textbook_full_cpy.pdf
textbook_full_original.pdf
pdf-generation/numbering.fdb_latexmk
pdf-generation/numbering.fls
pdf-generation/numbering.log
Expand Down
Loading