Skip to content

Commit ec47730

Browse files
authored
Actions: building draft book after every push
1 parent a8b3fd6 commit ec47730

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

.github/workflows/build-book.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Build book
2+
3+
# Controls when the workflow will run
4+
on:
5+
# Triggers the workflow on push or pull request events but only for the "master" branch
6+
push:
7+
branches: [ "master" ]
8+
9+
# Allows you to run this workflow manually from the Actions tab
10+
workflow_dispatch:
11+
12+
jobs:
13+
extract:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
# Runs a set of commands using the runners shell
18+
- name: Run a multi-line script
19+
run: |
20+
# Clone autogen repository (target for the file)
21+
git clone https://gcarcassi:${{ secrets.AUTOGEN_TOKEN }}@github.com/assumptionsofphysics/autogen autogen
22+
# Output the directory contents for debugging
23+
ls -l
24+
# Use latexonline to build latest version
25+
cd autogen
26+
curl "https://latexonline.cc/compile?git=https%3A%2F%2Fgithub.com%2Fassumptionsofphysics%2Fbook&target=book.tex&command=pdflatex&trackId=1505754735843" -o AssumptionsOfPhysicsDraft.pdf
27+
ls -l
28+
git add AssumptionsOfPhysicsDraft.pdf
29+
# Commit and push only if there were changes
30+
if ! git diff --cached --quiet; then
31+
git config user.name "gcarcassi[bot]"
32+
git config user.email "gabriele.carcassi@gmail.com"
33+
git commit -m "Updating book draft"
34+
git push
35+
else
36+
echo "No changes to commit."
37+
fi

0 commit comments

Comments
 (0)