Skip to content

Commit 2d9b724

Browse files
always update build env to allow deploy pr to trigger
1 parent e2f19b9 commit 2d9b724

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

.github/workflows/update_build_environment.yml

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ name: Rebuild and publish new ubcdsci/py-intro-to-ds image on DockerHub
22
on:
33
pull_request:
44
types: [opened, synchronize]
5-
paths:
6-
- Dockerfile
5+
76
jobs:
87
rebuild-docker:
98
runs-on: ubuntu-latest
@@ -20,17 +19,12 @@ jobs:
2019
run: |
2120
echo "GitHub PR action type: ${{ github.event.action }}"
2221
echo "Checking if the PR modifies the Dockerfile"
23-
if [[ ${{ github.event.action }} == 'opened' ]]; then
24-
echo "PR just opened, and it edits the Dockerfile, so rebuilding the image."
25-
echo "stale_dockerfile=true" >> "$GITHUB_OUTPUT"
22+
if git diff --quiet ${{ github.event.before }} ${{ github.event.after }} Dockerfile; then
23+
echo "PR synchronized, but Dockerfile was not edited. Not rebuilding the image."
24+
echo "stale_dockerfile=false" >> "$GITHUB_OUTPUT"
2625
else
27-
if git diff --quiet ${{ github.event.before }} ${{ github.event.after }} Dockerfile; then
28-
echo "PR synchronized, but Dockerfile was not edited. Not rebuilding the image."
29-
echo "stale_dockerfile=false" >> "$GITHUB_OUTPUT"
30-
else
31-
echo "PR synchronized, and Dockerfile was edited, so rebuilding the image."
32-
echo "stale_dockerfile=true" >> "$GITHUB_OUTPUT"
33-
fi
26+
echo "PR synchronized, and Dockerfile was edited, so rebuilding the image."
27+
echo "stale_dockerfile=true" >> "$GITHUB_OUTPUT"
3428
fi
3529
- name: Rebuild and publish image
3630
if: ${{ steps.check-stale.outputs.stale_dockerfile == 'true' }}

0 commit comments

Comments
 (0)