Bump docker/build-push-action from 5 to 6 #192
Workflow file for this run
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
name: Publish Docker Image | |
# https://www.docker.com/blog/first-docker-github-action-is-here | |
# https://github.com/docker/build-push-action | |
on: # Trigger the workflow on push or pull request, but only for the master branch | |
push: | |
branches: [master] | |
pull_request: | |
branches: [master] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref }} | |
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }} | |
jobs: | |
build-push: | |
runs-on: ubuntu-20.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
ubuntu_version: ["20.04"] | |
python_version: ["2.7", "3.6", "3.7", "3.8", "3.9"] | |
opencv_version: ["4.10.0"] | |
device: ["cpu", "gpu"] | |
include: | |
- { ubuntu_version: "22.04", python_version: "3.10", opencv_version: "4.10.0", device: "cpu" } | |
- { ubuntu_version: "22.04", python_version: "3.10", opencv_version: "4.10.0", device: "gpu" } | |
- { ubuntu_version: "22.04", python_version: "3.11", opencv_version: "4.10.0", device: "cpu" } | |
- { ubuntu_version: "22.04", python_version: "3.11", opencv_version: "4.10.0", device: "gpu" } | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
# https://github.com/docker/setup-buildx-action | |
# Set up Docker Buildx - to use cache-from and cache-to argument of buildx command | |
- uses: docker/setup-buildx-action@v3 | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
if: github.ref == 'refs/heads/master' | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- uses: docker/build-push-action@v6 | |
# https://github.com/docker/build-push-action#cache-to-registry | |
with: | |
build-args: | | |
UBUNTU_VERSION=${{ matrix.ubuntu_version }} | |
PYTHON_VERSION=${{ matrix.python_version }} | |
OPENCV_VERSION=${{ matrix.opencv_version }} | |
file: ${{ matrix.device }}/Dockerfile | |
# publish master | |
push: ${{ github.ref == 'refs/heads/master' }} | |
tags: borda/docker_python-opencv-ffmpeg:${{ matrix.device }}-py${{ matrix.python_version }}-cv${{ matrix.opencv_version }} | |
timeout-minutes: 240 |