Auto-build Docker images before on-merge if setup.py was changed (#17573)
* Auto-build on setup modification * Modify push-caller * Make adjustments based on code review
This commit is contained in:
1
.github/workflows/build-docker-images.yml
vendored
1
.github/workflows/build-docker-images.yml
vendored
@@ -5,6 +5,7 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- docker-image*
|
- docker-image*
|
||||||
repository_dispatch:
|
repository_dispatch:
|
||||||
|
workflow_call:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: "0 1 * * *"
|
- cron: "0 1 * * *"
|
||||||
|
|
||||||
|
|||||||
31
.github/workflows/self-push-caller.yml
vendored
31
.github/workflows/self-push-caller.yml
vendored
@@ -13,9 +13,40 @@ on:
|
|||||||
- "utils/**"
|
- "utils/**"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
check-for-setup:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
name: Check if setup was changed
|
||||||
|
outputs:
|
||||||
|
changed: ${{ steps.was_changed.outputs.changed }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: "2"
|
||||||
|
|
||||||
|
- name: Get changed files
|
||||||
|
id: changed-files
|
||||||
|
uses: tj-actions/changed-files@v22.2
|
||||||
|
|
||||||
|
- name: Was setup changed
|
||||||
|
id: was_changed
|
||||||
|
run: |
|
||||||
|
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
|
||||||
|
if [ `basename "${file}"` = "setup.py" ]; then
|
||||||
|
echo ::set-output name=changed::"1"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
build-docker-containers:
|
||||||
|
needs: check-for-setup
|
||||||
|
if: (github.event_name == 'push') && (needs.check-for-setup.outputs.changed == '1')
|
||||||
|
uses: ./.github/workflows/build-docker-images.yml
|
||||||
|
secrets: inherit
|
||||||
|
|
||||||
run_push_ci:
|
run_push_ci:
|
||||||
name: Trigger Push CI
|
name: Trigger Push CI
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
if: ${{ always() }}
|
||||||
|
needs: build-docker-containers
|
||||||
steps:
|
steps:
|
||||||
- name: Trigger push CI via workflow_run
|
- name: Trigger push CI via workflow_run
|
||||||
run: echo "Trigger push CI via workflow_run"
|
run: echo "Trigger push CI via workflow_run"
|
||||||
Reference in New Issue
Block a user