# This workflow uses actions that are not certified by GitHub. # They are provided by a third-party and are governed by # separate terms of service, privacy policy, and support # documentation. # GitHub recommends pinning actions to a commit SHA. # To get a newer version, you will need to update the SHA. # You can also reference a tag or branch, but the action may change without warning. name: Publish Docker image on: release: types: [published] jobs: test_smart_crop_video: name: Test smart-crop-video before publishing runs-on: ubuntu-latest if: startsWith(github.event.release.tag_name, 'smart-crop-video-v') steps: - name: Checkout uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 with: python-version: '3.11' - name: Install dependencies run: | cd smart-crop-video pip install -r tests/requirements.txt playwright install chromium - name: Run container tests run: | cd smart-crop-video pytest tests/test_container.py -v --tb=short timeout-minutes: 15 - name: Run basic API tests run: | cd smart-crop-video # Run only the fast API tests, skip the long-running ones pytest tests/test_api.py -v --tb=short -k "not candidates and not preview and not select and not acceleration and not scene" timeout-minutes: 10 push_to_registry: needs: test_smart_crop_video if: | always() && (needs.test_smart_crop_video.result == 'success' || needs.test_smart_crop_video.result == 'skipped') name: Push Docker image to Docker Hub runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Determine which utilities to build id: utils run: | TAG_NAME="${{ github.event.release.tag_name }}" # Determine which utilities to build based on tag prefix if [[ $TAG_NAME == network-mapper-v* ]] || [[ $TAG_NAME == v* ]]; then echo "build_network_mapper=true" >> $GITHUB_OUTPUT else echo "build_network_mapper=false" >> $GITHUB_OUTPUT fi if [[ $TAG_NAME == smart-crop-video-v* ]]; then echo "build_smart_crop=true" >> $GITHUB_OUTPUT else echo "build_smart_crop=false" >> $GITHUB_OUTPUT fi if [[ $TAG_NAME == mov-to-gif-v* ]]; then echo "build_mov_to_gif=true" >> $GITHUB_OUTPUT else echo "build_mov_to_gif=false" >> $GITHUB_OUTPUT fi if [[ $TAG_NAME == update-pdf-v* ]]; then echo "build_update_pdf=true" >> $GITHUB_OUTPUT else echo "build_update_pdf=false" >> $GITHUB_OUTPUT fi if [[ $TAG_NAME == stress-v* ]]; then echo "build_stress=true" >> $GITHUB_OUTPUT else echo "build_stress=false" >> $GITHUB_OUTPUT fi if [[ $TAG_NAME == onedrive-backup-v* ]]; then echo "build_onedrive_backup=true" >> $GITHUB_OUTPUT else echo "build_onedrive_backup=false" >> $GITHUB_OUTPUT fi if [[ $TAG_NAME == unraid-util-v* ]]; then echo "build_unraid_util=true" >> $GITHUB_OUTPUT else echo "build_unraid_util=false" >> $GITHUB_OUTPUT fi - name: Set up QEMU uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Login to Docker Hub uses: docker/login-action@v3 with: username: nickborgers password: ${{ secrets.DOCKER_HUB_PAT }} - name: Build and push mov-to-gif if: steps.utils.outputs.build_mov_to_gif == 'true' uses: docker/build-push-action@v5 with: context: ./mov-to-gif/ file: ./mov-to-gif/Dockerfile platforms: linux/amd64,linux/arm64 push: true tags: nickborgers/mov-to-gif:latest,nickborgers/mov-to-gif:${{ github.ref_name }} - name: Build and push update-pdf if: steps.utils.outputs.build_update_pdf == 'true' uses: docker/build-push-action@v5 with: context: ./update-pdf/ file: ./update-pdf/Dockerfile platforms: linux/amd64,linux/arm64 push: true tags: nickborgers/update-pdf:latest,nickborgers/update-pdf:${{ github.ref_name }} - name: Build and push stress if: steps.utils.outputs.build_stress == 'true' uses: docker/build-push-action@v5 with: context: ./stress/ file: ./stress/Dockerfile platforms: linux/amd64,linux/arm64 push: true tags: nickborgers/stress:latest,nickborgers/stress:${{ github.ref_name }} - name: Build and push onedrive-backup if: steps.utils.outputs.build_onedrive_backup == 'true' uses: docker/build-push-action@v5 with: context: ./onedrive-backup/ file: ./onedrive-backup/Dockerfile platforms: linux/amd64,linux/arm64 push: true tags: nickborgers/onedrive-backup:latest,nickborgers/onedrive-backup:${{ github.ref_name }} - name: Build and push unraid-util if: steps.utils.outputs.build_unraid_util == 'true' uses: docker/build-push-action@v5 with: context: ./unraid-util/ file: ./unraid-util/Dockerfile platforms: linux/amd64,linux/arm64 push: true tags: nickborgers/unraid-util:latest,nickborgers/unraid-util:${{ github.ref_name }} - name: Build and push smart-crop-video if: steps.utils.outputs.build_smart_crop == 'true' uses: docker/build-push-action@v5 with: context: ./smart-crop-video/ file: ./smart-crop-video/Dockerfile platforms: linux/amd64,linux/arm64 push: true tags: nickborgers/smart-crop-video:latest,nickborgers/smart-crop-video:${{ github.ref_name }}