Skip to content

Commit 8322f6e

Browse files
committed
Build image on CI on Dockerfile changes in PR.
1 parent f98a85f commit 8322f6e

1 file changed

Lines changed: 16 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,9 +198,23 @@ jobs:
198198
username: ${{ github.actor }}
199199
password: ${{ secrets.GITHUB_TOKEN }}
200200

201-
- name: Try to pull Docker test image
201+
- name: Check for Docker file changes
202+
uses: dorny/paths-filter@v3
203+
id: docker-changes
204+
with:
205+
filters: |
206+
docker:
207+
- 'Dockerfile'
208+
- 'docker-compose.yml'
209+
210+
- name: Pull or build Docker test image
202211
run: |
203-
docker compose pull
212+
if [ "${{ steps.docker-changes.outputs.docker }}" = "true" ]; then
213+
echo "Dockerfile changed — building image locally"
214+
docker compose build
215+
else
216+
docker compose pull
217+
fi
204218
205219
- name: Make shellspec executable
206220
run: chmod +x ./shellspec

0 commit comments

Comments
 (0)