2121 src-changes : ${{ steps.changed-files.outputs.src_any_changed }}
2222 test-changes : ${{ steps.changed-files.outputs.tests_any_changed }}
2323 lint-changes : ${{ steps.changed-files.outputs.lint_any_changed }}
24+ docker-changes : ${{ steps.changed-files.outputs.docker_any_changed }}
2425
2526 steps :
2627 - uses : actions/checkout@v4
5455 - src/**
5556 - notebooks/**
5657 - pyproject.toml
58+ docker:
59+ - .github/workflows/build_and_push_docker_images.yaml
60+ - containers/**
61+ - notebooks/**
62+ - src/**
5763
5864 - name : Detect if any of the combinations of file sets have changed
5965 id : all-changes
6470 [ "${{ steps.changed-files.outputs.docs_any_changed }}" == "true" ] || \
6571 [ "${{ steps.changed-files.outputs.src_any_changed }}" == "true" ] || \
6672 [ "${{ steps.changed-files.outputs.tests_any_changed }}" == "true" ] || \
67- [ "${{ steps.changed-files.outputs.lint_any_changed }}" == "true" ]; then
73+ [ "${{ steps.changed-files.outputs.lint_any_changed }}" == "true" ] || \
74+ [ "${{ steps.changed-files.outputs.docker_any_changed }}" == "true" ]; then
6875 printf '%s\n' "any_changed=true" >> $GITHUB_OUTPUT
6976 fi
7077
@@ -325,16 +332,18 @@ jobs:
325332 with :
326333 github_token : ${{ secrets.GITHUB_TOKEN }}
327334
328- prepare_docs_input :
335+ prepare_publish_input :
329336 name : Check if published
330337 runs-on : ubuntu-latest
331- if : needs.changes.outputs.doc-changes == 'true' && always()
338+ if : ( needs.changes.outputs.doc-changes == 'true' || needs.changes.outputs.docker-changes == 'true') && always()
332339 outputs :
333- publish : ${{ steps.check_publish.outputs.publish }}
340+ docs_publish : ${{ steps.check_docs_publish.outputs.publish }}
341+ image_publish : ${{ steps.check_image_publish.outputs.publish }}
334342 needs : [changes, upload_github, upload_pypi]
335343 steps :
336344 - name : Check if documentation should be published
337- id : check_publish
345+ id : check_docs_publish
346+ if : needs.changes.outputs.doc-changes == 'true'
338347 run : |
339348 # If either the PyPI or GitHub release was successful, publish the docs
340349 if ${{ needs.upload_github.result == 'success' }} || ${{ needs.upload_pypi.result == 'success' }}; then
@@ -347,11 +356,28 @@ jobs:
347356 echo "publish=false" >> $GITHUB_OUTPUT
348357 fi
349358 fi
359+ - name : Check if Docker images should be published
360+ id : check_image_publish
361+ if : needs.changes.outputs.docker-changes == 'true'
362+ run : |
363+ # If either the PyPI or GitHub release was successful, publish the Docker images
364+ if ${{ needs.upload_github.result == 'success' }} || ${{ needs.upload_pypi.result == 'success' }}; then
365+ echo "publish=true" >> $GITHUB_OUTPUT
366+ fi
350367
351368 docs :
352369 name : Build and deploy documentation
353370 uses : ./.github/workflows/documentation.yaml
354- needs : [changes, prepare_docs_input ]
371+ needs : [changes, prepare_publish_input ]
355372 if : github.repository == '3dct/viqa' && needs.changes.outputs.doc-changes == 'true'
356373 with :
357- publish : ${{ needs.prepare_docs_input.outputs.publish }}
374+ publish : ${{ needs.prepare_publish_input.outputs.docs_publish }}
375+
376+ build_and_push_docker_images :
377+ name : Build and push Docker Images
378+ uses : ./.github/workflows/build_and_push_docker_images.yaml
379+ needs : [changes, semantic_release, prepare_publish_input]
380+ if : github.repository == '3dct/viqa' && needs.changes.outputs.docker-changes == 'true'
381+ with :
382+ version : ${{ needs.semantic_release.outputs.version }}
383+ publish : ${{ needs.prepare_publish_input.outputs.image_publish }}
0 commit comments