Codify new aggregation deploy scheme (#381) #28
Workflow file for this run
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: Apply Modified Ingresses | |
on: | |
push: | |
tags: | |
- production-ingresses | |
workflow_dispatch: | |
jobs: | |
apply_ingresses: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
- 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/[email protected] | |
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/[email protected] | |
- 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 }} |