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 Apr 4, 2024
1 parent 8fa9afd commit 16cc4ed
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions .github/workflows/check-and-ebook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 16cc4ed

Please sign in to comment.