-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (67 loc) · 1.92 KB
/
scale.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Scale Edge Sites
on:
push:
branches:
- '**'
- '!main'
paths:
- '.azure/scale.csv'
workflow_call:
inputs:
branch:
required: true
type: string
permissions:
contents: write
id-token: write
jobs:
scale:
environment: terraform
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
# checkout to input branch when input branch is not empty
- name: Checkout to input branch
if: ${{ inputs.branch != '' }}
run: |
git fetch origin ${{ inputs.branch }}
git checkout ${{ inputs.branch }}
# Install node
- uses: actions/setup-node@v4
with:
node-version: latest
- run: node --version
# az login
- name: Log in to Azure using OIDC
uses: azure/login@v1
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
# check first 18 characters of az account user name
- name: Check az account
run: az account show --query user.name --output tsv | cut -c 1-18
# Download az-edge-site-scale
- name: Download az-edge-site-scale
run: |
wget "https://aka.ms/az-edge-site-scale-linux-amd64" -O az-edge-site-scale
chmod +x az-edge-site-scale
./az-edge-site-scale -v
# Run az-edge-site-scale scale
- name: Run az-edge-site-scale scale
run: |
./az-edge-site-scale scale -c ./.azure/scale.csv
rm ./az-edge-site-scale
- name: Clean up
run: |
rm ./.azure/scale.csv
# Commit and push the changes
- name: Commit and push the changes
if: always()
run: |
git config --global user.email "[email protected]"
git config --global user.name "IaC Scaler"
git add .
git commit -m "Scale more sites according to .azure/scale.csv"
git push