@@ -22,21 +22,10 @@ jobs:
2222 id : changes
2323 run : |
2424 CHANGED=0
25- # Fetch the latest changes
2625 git fetch origin main
27-
28- # Check if there are more than one commit to compare against
29- if [ "$(git rev-list --count HEAD)" -gt 1 ]; then
30- # Ensure that there is more than 1 commit in the history
31- if git diff --name-only HEAD^ HEAD | grep -E "^(.docker/|.*\.(tex|sty|cls)$)" > /dev/null; then
26+ if [[ $(git diff --name-only origin/main HEAD) =~ ^(\.docker\/|.*\.tex$|.*\.sty$|.*\.cls$) ]]; then
3227 CHANGED=1
33- fi
34- else
35- # If there's no previous commit (only 1 commit), assume no changes to the relevant files
36- echo "Only one commit or no previous commit, skipping change check."
37- CHANGED=0
3828 fi
39-
4029 echo "changed=${CHANGED}" >> $GITHUB_OUTPUT
4130
4231 - name : Set up Docker
5847 context : .docker
5948 push : true
6049 tags : ghcr.io/${{ github.repository }}/latex-builder:latest
61- cache-from : |
62- type=registry,ref=ghcr.io/${{ github.repository }}/latex-builder:buildcache
63- type=registry,ref=ghcr.io/${{ github.repository }}/latex-builder:latest
50+ cache-from : type=registry,ref=ghcr.io/${{ github.repository }}/latex-builder:(buildcache,latest)
6451 cache-to : type=registry,ref=ghcr.io/${{ github.repository }}/latex-builder:buildcache,mode=max
6552
66- - name : Pull latest Docker image
67- if : steps.changes.outputs.changed == '1'
68- run : docker pull ghcr.io/${{ github.repository }}/latex-builder:latest
69-
7053 - name : Build LaTeX document
7154 if : steps.changes.outputs.changed == '1'
7255 run : |
0 commit comments