Skip to content

Commit

Permalink
Conditionaliy publish latest tag for cli docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
var77 committed Feb 20, 2024
1 parent 50fdb62 commit 5c28989
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion .github/workflows/publish-cli-docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: publish-cli-docker
on:
workflow_dispatch:
inputs:
LATEST:
type: boolean
description: "Publish as latest release"
required: false
default: false
VERSION:
type: string
description: "CLI version"
Expand Down Expand Up @@ -40,9 +45,22 @@ jobs:
registry: ${{ secrets.GCP_REGION }}-docker.pkg.dev
username: _json_key_base64
password: ${{ secrets.GCP_CREDENTIALS_JSON_B64 }}
- name: Build and push
- name: Build and push without latest tags
uses: docker/build-push-action@v5
id: build_image
if: ${{ inputs.LATEST == false || inputs.LATEST == 'false' }}
with:
context: .
platforms: linux/amd64
file: Dockerfile.cli${{ (matrix.device == 'gpu' && '.cuda' || '') }}
push: true
tags: |
${{ inputs.IMAGE_NAME }}:${{ inputs.VERSION }}-${{ matrix.device }}
${{ secrets.GCP_REGION }}-docker.pkg.dev/${{ secrets.GCP_PROJECT_ID }}/${{ inputs.IMAGE_NAME }}:${{ inputs.VERSION }}-${{ matrix.device }}
- name: Build and push with latest tags
uses: docker/build-push-action@v5
id: build_image
if: ${{ inputs.LATEST == true || inputs.LATEST == 'true' }}
with:
context: .
platforms: linux/amd64
Expand Down

0 comments on commit 5c28989

Please sign in to comment.