diff --git a/.github/workflows/check-and-ebook.yml b/.github/workflows/check-and-ebook.yml index 00523119..c0eb80e6 100644 --- a/.github/workflows/check-and-ebook.yml +++ b/.github/workflows/check-and-ebook.yml @@ -26,6 +26,29 @@ jobs: persist-credentials: false fetch-depth: 1 # 0 if you want to push to repo + - name: calculate hash on chapters/*.tex + id: calculate-hash + run: | + current_date=$(date -u '+%Y-%m-%d') + echo "hash=${current_date}.${{ hashFiles('chapters/*.tex') }}" >> $GITHUB_OUTPUT + + - name: Cache lookup + id: cache + uses: actions/cache@v2 + with: + path: ~/.cache + key: chapter-hash-for-ebook-${{ steps.calculate-hash.outputs.hash }} + + - name: Check if hash has changed + id: check-hash + run: | + if [[ -z "${{ steps.cache.outputs.cache-hit }}" ]]; then + echo "Hash changed. Proceeding with the workflow." + else + echo "Hash unchanged. Exiting the workflow." + exit 0 + fi + - name: python set up uses: actions/setup-python@v5 with: @@ -60,29 +83,6 @@ jobs: persist-credentials: false fetch-depth: 1 # 0 if you want to push to repo - - name: calculate hash on chapters/*.tex - id: calculate-hash - run: | - current_date=$(date -u '+%Y-%m-%d') - echo "hash=${current_date}.${{ hashFiles('chapters/*.tex') }}" >> $GITHUB_OUTPUT - - - name: Cache lookup - id: cache - uses: actions/cache@v2 - with: - path: ~/.cache - key: chapter-hash-for-ebook-${{ steps.calculate-hash.outputs.hash }} - - - name: Check if hash has changed - id: check-hash - run: | - if [[ -z "${{ steps.cache.outputs.cache-hit }}" ]]; then - echo "Hash changed. Proceeding with the workflow." - else - echo "Hash unchanged. Exiting the workflow." - exit 0 - fi - - name: python set up uses: actions/setup-python@v5 with: