-
Notifications
You must be signed in to change notification settings - Fork 63
91 lines (88 loc) · 3.68 KB
/
manual_publish.yml
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: Image publishing
on:
workflow_dispatch:
inputs:
package_url:
description: 'URL to OpenVINO package'
required: true
default: ''
distribution:
description: 'Distribution of OpenVINO package: dev, runtime'
required: true
default: 'dev'
os:
description: 'OS for Docker image: ubuntu20, winserver2019, windows20h2'
required: true
default: ''
host_os:
description: 'OS for Host machine: ubuntu-20.04, windows-docker'
required: true
default: ''
tags:
description: 'Tags, ex. -t image_name:YYYY.U -t image_name:YYYY.U_src -t image_name:latest'
required: true
default: ''
args:
description: 'Additional arguments, ex. --build_arg no_samples=True --build_arg INSTALL_SOURCES=yes'
required: false
default: ''
permissions: read-all
jobs:
manual_publish:
strategy:
matrix:
os: [ ubuntu-20.04, windows-docker ]
runs-on: ${{ matrix.os }}
steps:
- name: Code checkout
uses: actions/checkout@v2
- name: Setting up Python
uses: actions/setup-python@v2
with:
python-version: '3.7'
- name: Setting up Python dependencies
if: ${{ matrix.os == github.event.inputs.host_os }}
run: python -m pip install -r requirements.txt
- name: Docker login to registry (Linux)
if: ${{ matrix.os == 'ubuntu-20.04' }}
run: echo $DOCKER_PASSWORD | docker login --username $DOCKER_USERNAME --password-stdin
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
- name: Docker login to registry (Windows)
if: ${{ matrix.os == 'windows-docker' }}
run: echo $Env:DOCKER_PASSWORD | docker login --username $Env:DOCKER_USERNAME --password-stdin
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and publish image on DockerHub
if: ${{ matrix.os == github.event.inputs.host_os }}
run: python docker_openvino.py all --dist ${{ github.event.inputs.distribution }} -os ${{ github.event.inputs.os }} --package_url ${{ github.event.inputs.package_url }} --nightly -r openvino ${{ github.event.inputs.tags }} ${{ github.event.inputs.args }}
- name: Docker logout
run: docker logout
- name: Docker login to Azure registry (Linux)
if: ${{ matrix.os == 'ubuntu-20.04' && contains(github.event.inputs.os, 'ubuntu') }}
run: echo $AZURE_PASSWORD | docker login --username $AZURE_USERNAME --password-stdin openvino.azurecr.io
env:
AZURE_USERNAME: ${{ secrets.AZURE_USERNAME }}
AZURE_PASSWORD: ${{ secrets.AZURE_PASSWORD }}
- name: Docker login to Azure registry (Windows)
if: ${{ matrix.os == 'windows-docker' && contains(github.event.inputs.os, 'win') }}
run: echo $Env:AZURE_PASSWORD | docker login --username $Env:AZURE_USERNAME --password-stdin openvino.azurecr.io
env:
AZURE_USERNAME: ${{ secrets.AZURE_USERNAME }}
AZURE_PASSWORD: ${{ secrets.AZURE_PASSWORD }}
- name: Publish image on Azure
if: ${{ matrix.os == github.event.inputs.host_os }}
run: python docker_openvino.py deploy -r openvino.azurecr.io ${{ github.event.inputs.tags }}
- name: Docker logout Azure
run: docker logout openvino.azurecr.io
- name: Collecting artifacts
if: ${{ matrix.os == github.event.inputs.host_os }}
uses: actions/upload-artifact@v4
with:
name: logs
path: |
logs/
./*.html
./*.log