Skip to content

Commit 647fccc

Browse files
always run build env to allow deploy pr to trigger
1 parent 0b84c0f commit 647fccc

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

.github/workflows/update_build_environment.yml

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ name: Rebuild and publish new ubcdsci/intro-to-ds image on DockerHub
22
on:
33
pull_request:
44
types: [opened, synchronize]
5-
paths:
6-
- Dockerfile
75
jobs:
86
rebuild-docker:
97
name: Rebuild docker image
@@ -21,17 +19,12 @@ jobs:
2119
run: |
2220
echo "GitHub PR action type: ${{ github.event.action }}"
2321
echo "Checking if the PR modifies the Dockerfile"
24-
if [[ ${{ github.event.action }} == 'opened' ]]; then
25-
echo "PR just opened, and it edits the Dockerfile, so rebuilding the image."
26-
echo "stale_dockerfile=true" >> "$GITHUB_OUTPUT"
22+
if git diff --quiet ${{ github.event.before }} ${{ github.event.after }} Dockerfile; then
23+
echo "PR synchronized/opened, but Dockerfile was not edited. Not rebuilding the image."
24+
echo "stale_dockerfile=false" >> "$GITHUB_OUTPUT"
2725
else
28-
if git diff --quiet ${{ github.event.before }} ${{ github.event.after }} Dockerfile; then
29-
echo "PR synchronized, but Dockerfile was not edited. Not rebuilding the image."
30-
echo "stale_dockerfile=false" >> "$GITHUB_OUTPUT"
31-
else
32-
echo "PR synchronized, and Dockerfile was edited, so rebuilding the image."
33-
echo "stale_dockerfile=true" >> "$GITHUB_OUTPUT"
34-
fi
26+
echo "PR synchronized/opened, and Dockerfile was edited, so rebuilding the image."
27+
echo "stale_dockerfile=true" >> "$GITHUB_OUTPUT"
3528
fi
3629
- name: Rebuild and publish image
3730
if: ${{ steps.check-stale.outputs.stale_dockerfile == 'true' }}

0 commit comments

Comments
 (0)