forked from Borda/docker_python-opencv-ffmpeg
-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (44 loc) · 1.68 KB
/
docker-builds.yml
File metadata and controls
46 lines (44 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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:
python_version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
opencv_version: ["4.6.0"]
device: ["cpu", "gpu"]
steps:
- name: Checkout
uses: actions/checkout@v2
# 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@v2
- name: Login to DockerHub
uses: docker/login-action@v2
if: github.ref == 'refs/heads/master'
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- uses: docker/build-push-action@v3
# https://github.com/docker/build-push-action#cache-to-registry
with:
build-args: |
PYTHON_VERSION=${{ matrix.python_version }}
OPENCV_VERSION=${{ matrix.opencv_version }}
file: ${{ matrix.device }}/Dockerfile
# publish master
push: ${{ github.ref == 'refs/heads/master' }}
tags: dzynetech/docker_python-opencv-ffmpeg:${{ matrix.device }}-py${{ matrix.python_version }}-cv${{ matrix.opencv_version }}
timeout-minutes: 240