Skip to content

Commit

Permalink
fix(build-images): specify mode variable
Browse files Browse the repository at this point in the history
- set to "dev" or "prod"
- provide choice on UI workflow dispatch
Signed-off-by: Cameron Smith <[email protected]>
  • Loading branch information
cameronraysmith committed Dec 3, 2023
1 parent 2090890 commit 4e45d57
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions .github/workflows/build-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,26 @@ on:
required: true
type: boolean
default: false
mode:
description: "Container build mode ('dev' uses branch name image tags and 'prod' uses short sha.)"
required: true
type: choice
default: "dev"
options:
- dev
- prod
workflow_call:
inputs:
debug_enabled:
description: "Run with tmate.io debugging enabled"
required: true
type: boolean
default: false
mode:
description: "Container build mode ('dev' uses branch name image tags and 'prod' uses short sha.)"
required: true
type: string
default: "dev"
secrets:
GCP_ARTIFACT_REGISTRY_PATH:
description: "GCP Artifact Registry Path"
Expand Down Expand Up @@ -53,19 +66,23 @@ jobs:
uses: rlespinasse/github-slug-action@v4
with:
prefix: CI_
- name: Set Mode
run: echo "MODE=${{ github.event.inputs.mode }}" >> $GITHUB_ENV
- name: Setup tmate debug session
if: ${{ github.event.inputs.debug_enabled == 'true' }}
uses: mxschmitt/action-tmate@v3
- name: build
run: |
echo "commit sha $CI_GITHUB_SHA"
echo "ref $GITHUB_REF"
echo "ci ref $CI_GITHUB_REF"
echo "ref name $CI_GITHUB_REF_NAME"
echo "head ref $CI_GITHUB_HEAD_REF"
echo "CI commit sha: $CI_GITHUB_SHA"
echo "GitHub ref: $GITHUB_REF"
echo "CI ref: $CI_GITHUB_REF"
echo "CI ref name: $CI_GITHUB_REF_NAME"
echo "CI HEAD ref: $CI_GITHUB_HEAD_REF"
echo "Image build mode: $MODE"
argo version --short
argo submit .argo/build.yaml \
--generate-name="${CI_GITHUB_REPOSITORY_NAME_PART_SLUG}-build-${CI_GITHUB_SHA_SHORT}-" \
-p mode="$MODE" \
-p imageName1="${CI_GITHUB_REPOSITORY_NAME_PART_SLUG}" \
-p containerFilePath1="containers/pkg.Dockerfile" \
-p imageName2="${CI_GITHUB_REPOSITORY_NAME_PART_SLUG}-gpu" \
Expand Down

0 comments on commit 4e45d57

Please sign in to comment.