-
Notifications
You must be signed in to change notification settings - Fork 4
46 lines (41 loc) · 1.53 KB
/
startclusters.yml
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
name: start-cluster
on:
workflow_dispatch:
schedule:
# - cron: '0 4 * * 1-5' #utc Summer time
- cron: '0 5 * * 1-5' #utc Winter time
permissions:
id-token: write
contents: read
jobs:
start-dev-clusters:
runs-on: ubuntu-latest
environment: operations
env:
KV_GROUP: common-dev
ENVIROMENT: dev
steps:
- uses: actions/checkout@v4 #Clone Repo
- name: 'Az CLI login'
uses: azure/login@v2
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- name: Get GitHub Public IP
id: github_public_ip
run: echo "ipv4=$(curl 'https://ifconfig.me/ip')" >> $GITHUB_OUTPUT
- name: Add GitHub IP to KeyVault
run: |
az keyvault network-rule add --name "radix-keyv-${{ env.ENVIROMENT}}" \
--resource-group "${{ env.KV_GROUP}}" \
--ip-address ${{ steps.github_public_ip.outputs.ipv4 }} >/dev/null
- name: Lets sleep for 30 seconds for FW rule to complete
run: sleep 30s
- name: Start clusters
run: RADIX_ZONE_ENV=./scripts/radix-zone/radix_zone_dev.env TASK=start .github/workflows/scripts/dailytasks.sh
- name: Revoke GitHub IP on KeyVault
run: |
az keyvault network-rule remove --name "radix-keyv-${{ env.ENVIROMENT}}" \
--resource-group "${{ env.KV_GROUP}}" \
--ip-address ${{ steps.github_public_ip.outputs.ipv4 }} >/dev/null