Skip to content

Commit

Permalink
Add input override-image-tag
Browse files Browse the repository at this point in the history
  • Loading branch information
baksetercx committed Jan 21, 2025
1 parent 105f659 commit 23487bc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,8 @@ jobs:
pull-requests: write
security-events: write
environment: build
# Integration tests depend on deploy which depends on build, so we need to run build if integration tests have changed.
if: ${{ github.event_name != 'pull_request' || contains(needs.prepare-jobs.outputs.all-changed-files, 'build/action.yml') || contains(needs.prepare-jobs.outputs.all-changed-files, 'integrationtest/action.yml') }}
# Integration tests depend on deploy which depends on build, so we need to run build if deploy or integration tests have changed.
if: ${{ github.event_name != 'pull_request' || contains(needs.prepare-jobs.outputs.all-changed-files, 'build/action.yml') || contains(needs.prepare-jobs.outputs.all-changed-files, 'deploy/action.yml') || contains(needs.prepare-jobs.outputs.all-changed-files, 'integrationtest/action.yml') }}
steps:
- name: Checkout this repository
uses: actions/checkout@v4
Expand Down
12 changes: 9 additions & 3 deletions deploy/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@ inputs:
required: false
default: '.github/deploy/values.yml'
helm-chart-repository-url:
description: 'Location of Elvias Helm chart repository, should only be changed if testing a new version of the chart.'
description: "Location of Elvia's Helm chart repository; should only be changed if testing a new version of the chart."
required: false
default: ''
workload-type:
description: 'The type of workload to deploy to kubernetes. Must be `deployment` or `statefulset`.'
required: false
Expand All @@ -39,6 +38,12 @@ inputs:
description: 'Kubernetes cloud provider to deploy to: `AKS`, `GKE` or ISS (Elvia only).'
required: false
default: 'AKS'
override-image-tag:
description: |
Overrides the default image tag of 'github.sha-github.run_number'.
**This should not normally be set; only change this if you know what you are doing.**
required: false
default: ''
slack-channel:
description: 'Slack channel to notify on failure. Leave empty to disable notifications.'
required: false
Expand Down Expand Up @@ -136,14 +141,15 @@ runs:
--environment '${{ inputs.environment }}' \
--workload-type '${{ inputs.workload-type }}' \
--runtime-cloud-provider '${{ inputs.runtime-cloud-provider }}' \
--image-tag '${{ github.sha }}-${{ github.run_number }}' \
--image-tag "$IMAGE_TAG" \
--add-deployment-annotation \
--grafana-url "$GRAFANA_URL" \
--grafana-api-key "$GRAFANA_API_KEY" \
--run-id '${{ github.run_id }}' \
'${{ inputs.name }}'
env:
HELM_VALUES_FILE: ${{ inputs.helm-values-path == '' && inputs.helm-values-file || inputs.helm-values-path }}
IMAGE_TAG: ${{ inputs.override-image-tag == '' && format('{0}-{1}', github.sha, github.run_number) || inputs.override-image-tag }}
# Pass optional inputs as environment variables, since they can be empty.
# The CLI does not accept empty strings passed to the flags, e.g. `--gke-project-id ''` will cause an error.
3LV_AZURE_TENANT_ID: ${{ inputs.AZURE_TENANT_ID }}
Expand Down

0 comments on commit 23487bc

Please sign in to comment.