-
Notifications
You must be signed in to change notification settings - Fork 2
69 lines (59 loc) · 1.82 KB
/
apply_ingresses.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
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 }}