We can consider caching the Docker images and invalidating if any changes to Dockerfile or docker-compose.yaml happens in the PR, for example:
- name: Cache Docker Layers
uses: satackey/[email protected]
continue-on-error: true
with:
key: docker-cache-${{ runner.os }}-${{ hashFiles('**/Dockerfile', '**/docker-compose.yaml') }}
restore-keys: docker-cache-${{ runner.os }}-