forked from thomwolf/transformers
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto-build Docker images before on-merge if setup.py was changed (hug…
…gingface#17573) * Auto-build on setup modification * Modify push-caller * Make adjustments based on code review
- Loading branch information
1 parent
db803e5
commit 3c114cb
Showing
2 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ on: | |
branches: | ||
- docker-image* | ||
repository_dispatch: | ||
workflow_call: | ||
schedule: | ||
- cron: "0 1 * * *" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,9 +13,40 @@ on: | |
- "utils/**" | ||
|
||
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/[email protected] | ||
|
||
- 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: | ||
name: Trigger Push CI | ||
runs-on: ubuntu-latest | ||
if: ${{ always() }} | ||
needs: build-docker-containers | ||
steps: | ||
- name: Trigger push CI via workflow_run | ||
run: echo "Trigger push CI via workflow_run" |