Skip to content

Commit

Permalink
Update check-and-ebook.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
entorb committed May 17, 2024
1 parent fb47ef3 commit 0e92344
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions .github/workflows/check-and-ebook.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Check and Make eBook

# This workflow runs upon new commits (check and make) and PRs (check only)
# This workflow runs upon
# - push to main (check, make, publish)
# - create new PR (check, make)

on:
workflow_dispatch:
push:
Expand All @@ -27,6 +30,9 @@ jobs:
persist-credentials: false
fetch-depth: 1 # 0 if you want to push to repo

- name: Touch requirements.txt for pip caching
run: touch requirements.txt

- name: Calculate hash on chapters/*.tex
id: calculate-hash
run: |
Expand All @@ -46,7 +52,7 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: "3.12"
# cache: "pip"
cache: "pip"

- name: Check chapters for known issues
run: python3 -O scripts/check_chapters.py
Expand All @@ -59,8 +65,8 @@ jobs:
#
make:
needs: check
# do not run make for pull_requests and not for unchanged tex files
if: github.event_name != 'pull_request' && needs.check.outputs.cache-hit != 'true'
# do not run for unchanged tex files
if: needs.check.outputs.cache-hit == 'false'

runs-on: ubuntu-24.04

Expand All @@ -75,6 +81,7 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: "3.12"
# no package needed, so no caching
# cache: "pip"

# - name: setup environment to DE lang
Expand Down Expand Up @@ -120,6 +127,8 @@ jobs:
ls -l
- name: Publish eBooks to release
# run only for push into main
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: softprops/action-gh-release@v2
with:
tag_name: WorkInProgress
Expand Down

0 comments on commit 0e92344

Please sign in to comment.