Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
saliceti committed Jan 8, 2025
1 parent 105ea03 commit 3f4cd86
Showing 1 changed file with 67 additions and 0 deletions.
67 changes: 67 additions & 0 deletions .github/actions/deploy-ittms/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Deploy ITTMS to platform-test
description: Test deployment of an ITTMS review to the platform-test cluster

inputs:
azure-client-id:
description: Azure service principal or managed identity client ID when using OIDC
required: true
azure-subscription-id:
description: Azure service principal or managed identity subscription ID when using OIDC
required: true
azure-tenant-id:
description: Azure service principal or managed identity tenant ID when using OIDC
required: true

runs:
using: composite

steps:
- name: Checkout ITTMS repository
uses: actions/checkout@v4
with:
repository: DFE-Digital/itt-mentor-services
path: itt-mentor-services

- name: Set Environment variables
id: set_env_var
shell: bash
working-directory: itt-mentor-services
run: |
terraform_version=$(awk '/{/{f=/^terraform/;next}f' terraform/application/terraform.tf | grep -o [0-9\.]*)
echo "TERRAFORM_VERSION=$terraform_version" >> $GITHUB_ENV
- name: Use Terraform ${{ env.TERRAFORM_VERSION }}
uses: hashicorp/setup-terraform@v3
with:
terraform_version: ${{ env.TERRAFORM_VERSION }}
terraform_wrapper: false

- uses: azure/login@v2
with:
client-id: ${{ inputs.azure-client-id }}
tenant-id: ${{ inputs.azure-tenant-id }}
subscription-id: ${{ inputs.azure-subscription-id }}

- uses: DFE-Digital/github-actions/set-kubelogin-environment@master
with:
azure-client-id: ${{ inputs.azure-client-id }}
azure-tenant-id: ${{ inputs.azure-tenant-id }}
azure-subscription-id: ${{ inputs.azure-subscription-id }}

- name: Terraform apply
shell: bash
working-directory: itt-mentor-services
run: make pt-review ci terraform-apply
env:
DOCKER_IMAGE_TAG: main
PR_NUMBER: 9999

- name: Run healthcheck
shell: bash
working-directory: itt-mentor-services
run: |
external_urls=$(terraform -chdir=terraform/application output -json ingress_hostnames | jq -r '.[]')
for url in $external_urls; do
echo "Check health for $url/${{ inputs.healthcheck }}..."
curl -sS --fail "$url/${{ inputs.healthcheck }}" > /dev/null
done

0 comments on commit 3f4cd86

Please sign in to comment.