Skip to content

Commit

Permalink
Test input type.
Browse files Browse the repository at this point in the history
  • Loading branch information
riga committed Nov 5, 2023
1 parent 80dcb3f commit 1476b54
Showing 1 changed file with 20 additions and 15 deletions.
35 changes: 20 additions & 15 deletions .github/workflows/deploy_images_a9.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,25 @@ on:
inputs:
push_image:
description: "Push image to DockerHub?"
type: choice
required: true
default: "false"
options:
- "true"
- "false"
type: boolean
default: false

specific_job:
description: "Run a specific job? (py37|py38|py39|py310|py311)"
required: false
default: ""
description: "Run a specific job?"
type: choice
default: "no"
options:
- "no"
- py37
- py38
- py39
- py310
- py311
- example

jobs:
a9-py37:
if: ${{ github.event.inputs.specific_job == '' || contains(github.event.inputs.specific_job, 'py37') }}
if: ${{ github.event.inputs.specific_job == 'no' || contains(github.event.inputs.specific_job, 'py37') }}
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
Expand All @@ -28,6 +32,7 @@ jobs:
persist-credentials: false

- name: Build and deploy image 🐳
if: ${{ github.event.inputs.push_image }}
uses: ./.github/actions/build-image
with:
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
Expand All @@ -37,7 +42,7 @@ jobs:
push_image: ${{ github.event.inputs.push_image == 'true' }}

a9-py38:
if: ${{ github.event.inputs.specific_job == '' || contains(github.event.inputs.specific_job, 'py38') }}
if: ${{ github.event.inputs.specific_job == 'no' || contains(github.event.inputs.specific_job, 'py38') }}
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
Expand All @@ -55,7 +60,7 @@ jobs:
push_image: ${{ github.event.inputs.push_image == 'true' }}

a9-py39:
if: ${{ github.event.inputs.specific_job == '' || contains(github.event.inputs.specific_job, 'py39') }}
if: ${{ github.event.inputs.specific_job == 'no' || contains(github.event.inputs.specific_job, 'py39') }}
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
Expand All @@ -73,7 +78,7 @@ jobs:
push_image: ${{ github.event.inputs.push_image == 'true' }}

a9-py310:
if: ${{ github.event.inputs.specific_job == '' || contains(github.event.inputs.specific_job, 'py310') }}
if: ${{ github.event.inputs.specific_job == 'no' || contains(github.event.inputs.specific_job, 'py310') }}
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
Expand All @@ -91,7 +96,7 @@ jobs:
push_image: ${{ github.event.inputs.push_image == 'true' }}

a9-py311:
if: ${{ github.event.inputs.specific_job == '' || contains(github.event.inputs.specific_job, 'py311') }}
if: ${{ github.event.inputs.specific_job == 'no' || contains(github.event.inputs.specific_job, 'py311') }}
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
Expand All @@ -109,7 +114,7 @@ jobs:
push_image: ${{ github.event.inputs.push_image == 'true' }}

example:
if: ${{ github.event.inputs.push_image == 'true' && (github.event.inputs.specific_job == '' || contains(github.event.inputs.specific_job, 'example')) }}
if: ${{ github.event.inputs.push_image == 'true' && (github.event.inputs.specific_job == 'no' || contains(github.event.inputs.specific_job, 'example')) }}
needs: a9-py311
runs-on: ubuntu-latest
steps:
Expand Down

0 comments on commit 1476b54

Please sign in to comment.