Skip to content

Commit f058fe0

Browse files
author
Alexander Batashev
authored
[CI] Do not build containers on each commit (#5061)
Restrict push trigger only to commits that affect `devops/containers/**`: https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#example-using-positive-and-negative-patterns-1
1 parent 96012a4 commit f058fe0

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

.github/workflows/sycl_containers.yaml

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ on:
77
push:
88
branches:
99
- sycl
10+
paths:
11+
- 'devops/containers/**'
1012

1113
jobs:
1214
base_image_ubuntu2004:
@@ -18,21 +20,13 @@ jobs:
1820
uses: actions/checkout@v2
1921
with:
2022
fetch-depth: 2
21-
- name: Check if dependencies have changed
22-
id: deps_changed
23-
shell: bash {0}
24-
run: |
25-
git diff --exit-code HEAD~1 -- devops/containers/ubuntu2004_base.Dockerfile
26-
echo "::set-output name=flag::$?"
2723
- name: Login to GitHub Container Registry
28-
if: ${{ (github.event_name != 'push') || steps.deps_changed.outputs.flag}}
2924
uses: docker/login-action@v1
3025
with:
3126
registry: ghcr.io
3227
username: ${{ github.repository_owner }}
3328
password: ${{ secrets.GITHUB_TOKEN }}
3429
- name: Build and Push Container
35-
if: ${{ (github.event_name != 'push') || steps.deps_changed.outputs.flag}}
3630
uses: docker/build-push-action@v2
3731
with:
3832
push: true
@@ -52,21 +46,13 @@ jobs:
5246
uses: actions/checkout@v2
5347
with:
5448
fetch-depth: 2
55-
- name: Check if dependencies have changed
56-
id: deps_changed
57-
shell: bash {0}
58-
run: |
59-
git diff --exit-code HEAD~1 -- devops/containers/ubuntu2004_intel_drivers.Dockerfile
60-
echo "::set-output name=flag::$?"
6149
- name: Login to GitHub Container Registry
62-
if: ${{ (github.event_name != 'push') || steps.deps_changed.outputs.flag}}
6350
uses: docker/login-action@v1
6451
with:
6552
registry: ghcr.io
6653
username: ${{ github.repository_owner }}
6754
password: ${{ secrets.GITHUB_TOKEN }}
6855
- name: Build and Push Container
69-
if: ${{ (github.event_name != 'push') || steps.deps_changed.outputs.flag}}
7056
uses: docker/build-push-action@v2
7157
with:
7258
push: true

0 commit comments

Comments
 (0)