Fix docker check to only run on Dockerfile change (#452)
authorKrishan <33421343+kfiven@users.noreply.github.com>
Wed, 30 Mar 2022 13:08:52 +0000 (18:38 +0530)
committerGitHub <noreply@github.com>
Wed, 30 Mar 2022 13:08:52 +0000 (18:38 +0530)
.github/workflows/build-pull-request.yml
.github/workflows/docker-pr.yml [new file with mode: 0644]

index 71c785119f607bcdec86406d1ae1540414f6a192..d67ee15ddaf39a4c152024f0da916fc6d61001f9 100644 (file)
@@ -32,8 +32,3 @@ jobs:
           name: pr.json
           path: pr.json
           retention-days: 1
-      - name: Build Docker image
-        uses: docker/build-push-action@v2.10.0
-        with:
-          context: .
-          push: false
diff --git a/.github/workflows/docker-pr.yml b/.github/workflows/docker-pr.yml
new file mode 100644 (file)
index 0000000..29f41cc
--- /dev/null
@@ -0,0 +1,20 @@
+name: 'Docker check'
+
+on:
+  pull_request:
+    paths: 
+      - 'Dockerfile'
+
+jobs:
+  docker-build:
+    runs-on: ubuntu-latest
+    env:
+      PR_NUMBER: ${{github.event.number}}
+    steps:
+      - name: Checkout repository
+        uses: actions/checkout@v3.0.0
+      - name: Build Docker image
+        uses: docker/build-push-action@v2.10.0
+        with:
+          context: .
+          push: false