Bump actions/setup-python from v6 to v7 in /.github/workflows (#13818) #1020
This file contains hidden or 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
| # Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license | |
| # Builds ultralytics/yolov5:latest images on DockerHub https://hub.docker.com/r/ultralytics/yolov5 | |
| name: Publish Docker Images | |
| permissions: | |
| contents: read # Required for checkout only; Docker Hub push uses repository secrets. | |
| on: | |
| push: | |
| branches: [master] | |
| workflow_dispatch: | |
| jobs: | |
| docker: | |
| if: github.repository == 'ultralytics/yolov5' | |
| name: Build ${{ matrix.tag }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - dockerfile: utils/docker/Dockerfile-arm64 | |
| tag: latest-arm64 | |
| platform: linux/arm64 | |
| runs_on: ubuntu-24.04-arm | |
| - dockerfile: utils/docker/Dockerfile-cpu | |
| tag: latest-cpu | |
| platform: linux/amd64 | |
| runs_on: ubuntu-latest | |
| - dockerfile: utils/docker/Dockerfile | |
| tag: latest | |
| platform: linux/amd64 | |
| runs_on: ubuntu-latest | |
| runs-on: ${{ matrix.runs_on }} | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v7 | |
| with: | |
| fetch-depth: 0 # copy full .git directory to access full git history in Docker images | |
| - name: Login to Docker Hub | |
| uses: ultralytics/actions/retry@main | |
| env: | |
| DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} | |
| DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} | |
| with: | |
| run: | | |
| if ! out=$(printf '%s' "$DOCKERHUB_TOKEN" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin 2>&1); then | |
| printf '%s\n' "$out" >&2 | |
| exit 1 | |
| fi | |
| echo "Logged in to docker.io" | |
| - name: Build Docker image | |
| uses: ultralytics/actions/retry@main | |
| with: | |
| timeout_minutes: 120 | |
| retry_delay_seconds: 60 | |
| retries: 2 | |
| run: | | |
| docker build \ | |
| --platform ${{ matrix.platform }} \ | |
| --label "org.opencontainers.image.source=https://github.com/ultralytics/yolov5" \ | |
| --label "org.opencontainers.image.description=Ultralytics YOLOv5 image" \ | |
| --label "org.opencontainers.image.licenses=AGPL-3.0-or-later" \ | |
| -f ${{ matrix.dockerfile }} \ | |
| -t ultralytics/yolov5:${{ matrix.tag }} \ | |
| . | |
| - name: Push Docker image | |
| uses: ultralytics/actions/retry@main | |
| with: | |
| timeout_minutes: 15 | |
| retry_delay_seconds: 300 | |
| retries: 2 | |
| run: docker push ultralytics/yolov5:${{ matrix.tag }} |