Skip to content

Commit

Permalink
Update docker-build.yml
Browse files Browse the repository at this point in the history
Fixing docker-build.yml triggering events
  • Loading branch information
vfdev-5 authored Oct 18, 2023
1 parent f179a43 commit 80a1987
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ on:
- docker/**
- ".github/workflows/docker-build.yml"
push:
branches:
- master
paths:
- docker/**
- ".github/workflows/docker-build.yml"
release:
types: [published]
workflow_dispatch:


Expand All @@ -23,6 +23,7 @@ jobs:

setup:
name: Setup
if: ${{ github.event_name == 'pull_request' }}
runs-on: ubuntu-latest
outputs:
modified: ${{ steps.set-modified.outputs.modified }}
Expand Down Expand Up @@ -52,7 +53,7 @@ jobs:
build-hvd:
name: Build all Horovod flavoured PyTorch-Ignite images
needs: setup
if: contains(needs.setup.outputs.modified, 'hvd/') || contains(needs.setup.outputs.modified, 'docker.cfg')
if: (contains(needs.setup.outputs.modified, 'hvd/') || contains(needs.setup.outputs.modified, 'docker.cfg')) && ${{ github.event_name == 'pull_request' }}

# Cherry-picked from https://github.com/pytorch/test-infra/blob/main/.github/workflows/linux_job.yml
env:
Expand Down Expand Up @@ -98,7 +99,7 @@ jobs:
bash build.sh hvd hvd-nlp
- name: Publish docker images
if: ${{ (github.ref == 'refs/heads/master' && github.event_name == 'push') || github.event_name == 'release' }}
if: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'release' }}
env:
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
DOCKER_USER: ${{ secrets.DOCKER_USER }}
Expand All @@ -112,7 +113,7 @@ jobs:
build-hvd-apex:
name: Build all Horovod + Apex flavoured PyTorch-Ignite images
needs: setup
if: contains(needs.setup.outputs.modified, 'hvd/') || contains(needs.setup.outputs.modified, 'docker.cfg')
if: (contains(needs.setup.outputs.modified, 'hvd/') || contains(needs.setup.outputs.modified, 'docker.cfg')) && ${{ github.event_name == 'pull_request' }}

# Cherry-picked from https://github.com/pytorch/test-infra/blob/main/.github/workflows/linux_job.yml
env:
Expand Down Expand Up @@ -158,7 +159,7 @@ jobs:
bash build.sh hvd hvd-apex-nlp
- name: Publish docker images
if: ${{ (github.ref == 'refs/heads/master' && github.event_name == 'push') || github.event_name == 'release' }}
if: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'release' }}
env:
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
DOCKER_USER: ${{ secrets.DOCKER_USER }}
Expand All @@ -172,7 +173,7 @@ jobs:
build-main:
name: Build all PyTorch-Ignite images
needs: setup
if: contains(needs.setup.outputs.modified, 'main/') || contains(needs.setup.outputs.modified, 'docker.cfg')
if: (contains(needs.setup.outputs.modified, 'main/') || contains(needs.setup.outputs.modified, 'docker.cfg')) && ${{ github.event_name == 'pull_request' }}

# Cherry-picked from https://github.com/pytorch/test-infra/blob/main/.github/workflows/linux_job.yml
env:
Expand Down Expand Up @@ -218,7 +219,7 @@ jobs:
bash build.sh main nlp
- name: Publish docker images
if: ${{ (github.ref == 'refs/heads/master' && github.event_name == 'push') || github.event_name == 'release' }}
if: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'release' }}
env:
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
DOCKER_USER: ${{ secrets.DOCKER_USER }}
Expand All @@ -232,7 +233,7 @@ jobs:
build-main-apex:
name: Build all PyTorch-Ignite images with Apex
needs: setup
if: contains(needs.setup.outputs.modified, 'main/') || contains(needs.setup.outputs.modified, 'docker.cfg')
if: (contains(needs.setup.outputs.modified, 'main/') || contains(needs.setup.outputs.modified, 'docker.cfg')) && ${{ github.event_name == 'pull_request' }}

# Cherry-picked from https://github.com/pytorch/test-infra/blob/main/.github/workflows/linux_job.yml
env:
Expand Down Expand Up @@ -278,7 +279,7 @@ jobs:
bash build.sh main apex-nlp
- name: Publish docker images
if: ${{ (github.ref == 'refs/heads/master' && github.event_name == 'push') || github.event_name == 'release' }}
if: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'release' }}
env:
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
DOCKER_USER: ${{ secrets.DOCKER_USER }}
Expand Down

0 comments on commit 80a1987

Please sign in to comment.