added github action #3357
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Deploy | |
on: | |
workflow_dispatch: | |
pull_request: | |
push: | |
branches: [ feature/11223344-next-mapping ] | |
permissions: | |
contents: write | |
deployments: write | |
issues: write | |
packages: write | |
pull-requests: write | |
jobs: | |
deployments_aks: | |
name: Deployments aks | |
environment: | |
name: development_aks | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v3 | |
- name: set-up-environment | |
uses: DFE-Digital/github-actions/set-up-environment@master | |
- uses: Azure/login@v1 | |
with: | |
creds: ${{ secrets.AZURE_CREDENTIALS }} | |
- name: Set Environment variables | |
shell: bash | |
run: | | |
current="get-school-experience-review-pr-2973" | |
make review_test get-cluster-credentials | |
# find if it is already in list of ingresses | |
INGS=($(kubectl get ing -n git-development -o json | \ | |
jq -r '.items[] | select(.metadata.name | startswith("get-school-experience-review-pr")) | .metadata.name, .spec.rules[0].http.paths[0].backend.service.name')) | |
for ((i = 0; i < ${#INGS[@]}; i += 2)); do | |
itemname="${INGS[i]}" | |
backend_service="${INGS[i + 1]}" | |
echo "Name: ${itemname}" | |
echo "Backend Service: ${backend_service}" | |
if [ "$itemname" == "$current" ]; then | |
echo "found existing ${itemname} ${backend_service} " | |
fi | |
done |