Skip to content

Commit

Permalink
Enable pushing images through workflow_dispatch
Browse files Browse the repository at this point in the history
  • Loading branch information
wmaxey committed Jul 28, 2023
1 parent 3a4e2b7 commit 560a350
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions .github/workflows/dispatch-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,28 @@ concurrency:

on:
pull_request:
inputs:
push_image:
type: boolean
default: false
description: Enable pushing images
push:
branches:
- "pull-request/[0-9]+"
- "feature/.*"
paths: [.github/actions/windows_build.yml, scripts/windows/**]
inputs:
push_image:
type: boolean
default: false
description: Enable pushing images

workflow_dispatch:
inputs:
push_image:
type: boolean
default: false
description: Enable pushing images

jobs:
build-all-images:
Expand Down Expand Up @@ -40,7 +55,7 @@ jobs:
win_edition: ${{ matrix.edition }}
vs_version: ${{ matrix.vs_version }}
cuda_version: ${{ matrix.cuda_version }}
push_image: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
push_image: ${{ inputs.push_image }}

create-manifests:
name: Create Windows image manifests
Expand Down Expand Up @@ -70,8 +85,15 @@ jobs:
username: ${{ github.repository_owner }}
password: ${{ github.token }}

- name: Login to Docker Hub
if: ${{ inputs.push_image }}
uses: docker/login-action@v2
with:
username: ${{ secrets.GPUCIBOT_DOCKERHUB_USER }}
password: ${{ secrets.GPUCIBOT_DOCKERHUB_TOKEN }}

- name: Create manifest
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
if: ${{ inputs.push_image }}
uses: ./.github/actions/create-and-push-manifest
with:
vs_version: ${{ matrix.vs_version }}
Expand Down

0 comments on commit 560a350

Please sign in to comment.