Skip to content

Codify new aggregation deploy scheme (#381) #28

Codify new aggregation deploy scheme (#381)

Codify new aggregation deploy scheme (#381) #28

name: Apply Modified Ingresses
on:
push:
tags:
- production-ingresses
workflow_dispatch:
jobs:
apply_ingresses:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Fetch tags for comparison
run: |
git fetch --prune --unshallow --tags
- uses: azure/login@v2
with:
creds: ${{ secrets.AZURE_AKS }}
- name: Set the target AKS cluster
uses: Azure/aks-set-context@v4.0.0
with:
cluster-name: microservices
resource-group: kubernetes
- name: Get last applied ingress hash
run: |
echo "CURRENT_INGRESS_HASH=$(git show-ref --tags | grep production-ingress-release | cut -d ' ' -f 1)" >> $GITHUB_ENV
- name: Apply modified ingress files
run: |
output=$(git diff --name-only $CURRENT_INGRESS_HASH ${{ github.sha }})
echo "$output" | while read -r line
do
if [[ $line = *"kubernetes/ingress/"* ]]; then
echo "Applying $line..."
kubectl apply -f $line
fi
done
update_ingress_tag:
runs-on: ubuntu-latest
needs: apply_ingresses
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Update Ingress Tag
run: |
git tag production-ingress-release
git push --force origin --tags
deploy_slack_notification:
name: Deploy Slack notification
uses: zooniverse/ci-cd/.github/workflows/slack_notification.yaml@main
needs: update_ingress_tag
if: always()
with:
commit_id: ${{ github.sha }}
job_name: apply_ingresses
status: ${{ needs.apply_ingresses.result }}
title: "Static ingress application complete"
title_link: "https://static.zooniverse.org"
secrets:
slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }}