Skip to content

Workflow file for this run

concurrency: build_and_deploy_${{ github.ref_name }}
name: Deploy to AKS cluster
on:
push:
branches:
- 1717-ittms-manual-deployment-workflow-bug-fix-1
workflow_dispatch:
inputs:
environment:
description: Environment to deploy to
required: true
type: choice
default: review
options:
- qa
- review
- staging
- sandbox
- dv
sha:
description: Commit sha to be deployed
required: true
pr_number:
description: PR number
required: false
jobs:
deploy:
name: review deployment
env:
environment: review
concurrency: deploy_all
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: azure/login@v2
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Fetch secrets from key vault
if: ${{ environment != 'review' }}

Check failure on line 44 in .github/workflows/deploy.yml

View workflow run for this annotation

GitHub Actions / Deploy to AKS cluster

Invalid workflow file

The workflow is not valid. .github/workflows/deploy.yml (Line: 44, Col: 13): Unrecognized named-value: 'environment'. Located at position 1 within expression: environment != 'review' .github/workflows/deploy.yml (Line: 71, Col: 13): Unrecognized named-value: 'environment'. Located at position 1 within expression: environment == 'review'
uses: azure/CLI@v2
id: keyvault-yaml-secret
with:
inlineScript: |
SLACK_WEBHOOK=$(az keyvault secret show --name "SLACK-WEBHOOK" --vault-name "${{ secrets.INF_KEY_VAULT }}" --query "value" -o tsv)
echo "::add-mask::$SLACK_WEBHOOK"
echo "SLACK_WEBHOOK=$SLACK_WEBHOOK" >> $GITHUB_OUTPUT
- uses: ./.github/actions/deploy-environment
id: deploy
with:
environment: review
docker-image: edcd9c25360b3e8025d884e6e4eda09dd96fef9b
azure-credentials: ${{ secrets.AZURE_CREDENTIALS }}
pull-request-number: 4591
# - name: Seed Review App
# shell: bash
# if: github.event.inputs.pr_number!= '' && ${{ environment == 'review' }}
# run: |
# make ci review get-cluster-credentials
# kubectl exec -n bat-qa deployment/itt-mentor-services-4591 -- sh -c "export GIAS_CSV_BASE_URL=https://ea-edubase-api-prod.azurewebsites.net/edubase/downloads/public && export PUBLISH_BASE_URL=https://qa.api.publish-teacher-training-courses.service.gov.uk// && cd /app && /usr/local/bin/rake db:seed"
# env:
# PR_NUMBER: 4591
- name: Post comment to Pull Request 4591
if: ${{ environment == 'review' }}
uses: marocchino/sticky-pull-request-comment@v2
with:
header: aks
message: |
### Deployments
| App | URL |
| ----------------- | ---------------------------------------------------------------------------------------- |
| Track & Pay | <https://track-and-pay-4591.test.teacherservices.cloud> |
| School Placements | <https://manage-school-placements-4591.test.teacherservices.cloud> |
- name: Slack Notification
if: ${{ failure() && environment != 'review' }}
uses: rtCamp/action-slack-notify@master
env:
SLACK_COLOR: failure
SLACK_TITLE: Failure deploying release toreview
SLACK_MESSAGE: Failure deploying release to review - Docker tag ${{ github.event.inputs.sha }}
SLACK_WEBHOOK: ${{ steps.keyvault-yaml-secret.outputs.SLACK_WEBHOOK }}