Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/workflows/shared-build-deploy-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ jobs:
runs-on: ubuntu-latest
outputs:
environment: ${{ steps.load-environment.outputs.environment }}
runnerName: ${{ steps.load-environment.outputs.runnerName }}
tagPrefix: ${{ steps.load-environment.outputs.tagPrefix }}
steps:
- name: Checkout calling repo
Expand All @@ -66,7 +67,7 @@ jobs:
path: ./github-actions-shared-build-deploy-container
ref: ${{ inputs.actionsRepoRef }}

- name: Load environment
- name: Load environment and runner
id: load-environment
uses: ./github-actions-shared-build-deploy-container/load-environment

Expand Down Expand Up @@ -97,7 +98,7 @@ jobs:
build-push-container-image:
name: "Build and push container image"
needs: [ prepare-and-validate ]
runs-on: ubuntu-latest
runs-on: ${{ needs.prepare-and-validate.outputs.runnerName }}
steps:
- name: Checkout calling repo
uses: actions/checkout@v5
Expand Down Expand Up @@ -134,7 +135,7 @@ jobs:
deploy-kubernetes:
name: "Deploy image to Kubernetes"
needs: [ prepare-and-validate, build-push-container-image ]
runs-on: ubuntu-latest
runs-on: ${{ needs.prepare-and-validate.outputs.runnerName }}
if: |
always() &&
(needs.build-push-container-image.result == 'success' || (needs.build-push-container-image.result == 'skipped'
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/shared-deploy-container-kubernetes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ jobs:
runs-on: ubuntu-latest
outputs:
environment: ${{ steps.load-environment.outputs.environment }}
runnerName: ${{ steps.load-environment.outputs.runnerName }}
steps:
- name: Checkout calling repo
uses: actions/checkout@v5
Expand All @@ -51,20 +52,26 @@ jobs:
path: ./github-actions-shared-deploy-image
ref: ${{ inputs.actionsRepoRef }}

- name: "Detect Environment"
- name: "Detect Environment and Runner"
shell: bash
id: load-environment
run: |
if [[ "${{ inputs.environment }}" == "prod" ]]; then
DETECTED_ENVIRONMENT="production"
RUNNER_NAME="prod-trakx-runner"
elif [[ "${{ inputs.environment }}" == "stage" ]]; then
DETECTED_ENVIRONMENT="staging"
RUNNER_NAME="stage-trakx-runner"
else
DETECTED_ENVIRONMENT="development"
RUNNER_NAME="dev-trakx-runner"
fi

echo "Detected Environment is: $DETECTED_ENVIRONMENT"
echo "Detected Runner is: $RUNNER_NAME"

echo "environment=$DETECTED_ENVIRONMENT" >> $GITHUB_OUTPUT
echo "runnerName=$RUNNER_NAME" >> $GITHUB_OUTPUT

- name: Outputs if this is a workflow_dispatch for production (manual deploy)
shell: bash
Expand Down Expand Up @@ -93,7 +100,7 @@ jobs:
deploy-kubernetes:
name: "Deploy image to Kubernetes"
needs: [ prepare-and-validate ]
runs-on: ubuntu-latest
runs-on: ${{ needs.prepare-and-validate.outputs.runnerName }}
steps:
- name: Checkout calling repo
uses: actions/checkout@v5
Expand Down