Unverified Commit ed56d4db authored by Yuting Jiang's avatar Yuting Jiang Committed by GitHub
Browse files

CI/CD - add push win docker image on release branch in pipeline (#552)

**Description**
add push win docker image on release branch in pipeline.
parent 1aa5db25
......@@ -12,7 +12,7 @@ on:
jobs:
docker:
name: Docker build win2004
name: Docker build win directx12
runs-on: [self-hosted, windows, x64, win2004]
steps:
- name: Checkout
......@@ -24,6 +24,25 @@ jobs:
docker system prune -a -f
docker volume prune -a -f
shell: pwsh
- name: Set TAG variable based on the branch
run: |
if ($env:GITHUB_EVENT_NAME -match "release") {
$version = $env:GITHUB_REF.Substring($env:GITHUB_REF.LastIndexOf('/') + 1)
echo "TAG=superbench/superbench:$version-directx12" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
} elseif ($env:GITHUB_REF -match "refs/heads/release/(.*)") {
$version = $Matches[1]
echo "TAG=superbench/release:$version-directx12" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
} elseif ($env:GITHUB_BASEREF -match "release/(.*)"){
$version = $Matches[1]
echo "TAG=superbench/release:$version-directx12" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
} else {
echo "TAG=superbench/main:directx12" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
}
shell: pwsh
env:
GITHUB_REF: ${{ github.ref }}
GITHUB_BASEREF: ${{ github.base_ref }}
GITHUB_EVENT_NAME: ${{ github.event_name }}
- name: Build Docker image
working-directory: .
shell: pwsh
......@@ -37,7 +56,7 @@ jobs:
--isolation=process `
--tag $env:TAG .
env:
TAG: superbench/main:win2004
TAG: ${{ env.TAG }}
- name: Push Docker image
if: ${{ github.event_name != 'pull_request' }}
shell: pwsh
......@@ -46,7 +65,7 @@ jobs:
docker push $env:TAG
docker logout
env:
TAG: superbench/main:win2004
TAG: ${{ env.TAG }}
USER: ${{ secrets.DOCKERHUB_USERNAME }}
PASS: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Add bash to PATH
......@@ -64,7 +83,9 @@ jobs:
docker run --rm `
--isolation process `
--device class/5B45201D-F2F2-4F3B-85BB-30FF1F953599 `
-e CI=true $ci_env -e SB_TEST_CUDA="0" -e SB_TEST_ROCM="0" -e SB_TEST_PYTORCH="0" -e SB_TEST_DIRECTX="1" -e CODECOV_TOKEN superbench/main:win2004 cmd /c $command
-v C:/Windows/System32/DriverStore:C:/Windows/System32/DriverStore `
-e CI=true $ci_env -e SB_TEST_CUDA="0" -e SB_TEST_ROCM="0" -e SB_TEST_PYTORCH="0" -e SB_TEST_DIRECTX="1" -e CODECOV_TOKEN --entrypoint "cmd" $env:TAG "/c python dockerfile/directx/enable-graphics-apis.py && cmd /c $command"
shell: pwsh
env:
TAG: ${{ env.TAG }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
......@@ -157,5 +157,5 @@ directx_amf_encoding_latency:
curl -L -o vs_buildtools.exe https://aka.ms/vs/16/release/vs_buildtools.exe && echo "Downloaded vs_buildtools.exe" && \
start /wait vs_buildtools.exe --quiet --wait --norestart --nocache --installPath C:/temp/BuildTools --add Microsoft.VisualStudio.Workload.VCTools --add Microsoft.VisualStudio.Component.VC.ATLMFC --includeRecommended && echo "Installed VS Build Tools" && \
del vs_buildtools.exe && echo "Deleted vs_buildtools.exe" && \
"C:\temp\BuildTools\MSBuild\Current\Bin\MSBuild.exe" "AMF\amf\public\samples\CPPSamples_vs2019.sln" /t:EncoderLatency /p:Configuration=Release /p:OutDir="%SB_MICRO_PATH%\bin" \
"C:\temp\BuildTools\MSBuild\Current\Bin\MSBuild.exe" "AMF\amf\public\samples\CPPSamples_vs2019.sln" /t:EncoderLatency /p:Platform=x64 /p:Configuration=Release /p:OutDir="%SB_MICRO_PATH%\bin" \
)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment