Skip to content

Commit

Permalink
cleanup deployment files and add orgIds
Browse files Browse the repository at this point in the history
  • Loading branch information
Battlestad committed Dec 20, 2023
1 parent 64a5bb8 commit 7cc6b75
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 36 deletions.
65 changes: 32 additions & 33 deletions .github/workflows/CD.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,52 +53,51 @@ jobs:
strategy:
matrix:
include:
# Define default clusters
- &default_clusters
clusters:
- aks-api-fint-2022-02-08
- aks-beta-fint-2021-11-23
# Orgs using default clusters
- <<: *default_clusters
org: afk-no
- <<: *default_clusters
org: bfk-no
- <<: *default_clusters
org: innlandetfylke-no
- <<: *default_clusters
org: mrfylke-no
- <<: *default_clusters
org: nfk-no
- <<: *default_clusters
org: viken-no
- <<: *default_clusters
org: vlfk-no
- <<: *default_clusters
org: trondelagfylke-no
- <<: *default_clusters
org: tfk-no
- <<: *default_clusters
org: vfk-no

# Org with custom cluster setup
- org: fintlabs-no
cluster: aks-beta-fint-2021-11-23

- org: innlandetfylke-no
cluster: aks-api-fint-2022-02-08
- org: innlandetfylke-no
cluster: aks-beta-fint-2021-11-23

- org: mrfylke-no
cluster: aks-api-fint-2022-02-08
- org: mrfylke-no
cluster: aks-beta-fint-2021-11-23

- org: nfk-no
cluster: aks-api-fint-2022-02-08
- org: nfk-no
cluster: aks-beta-fint-2021-11-23

- org: viken-no
cluster: aks-api-fint-2022-02-08
- org: viken-no
cluster: aks-beta-fint-2021-11-23

- org: vlfk-no
cluster: aks-api-fint-2022-02-08
- org: vlfk-no
cluster: aks-beta-fint-2021-11-23

- org: trondelagfylke-no
cluster: aks-api-fint-2022-02-08
- org: trondelagfylke-no
cluster: aks-beta-fint-2021-11-23
clusters:
- aks-beta-fint-2021-11-23

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Get environment
uses: actions/github-script@v6
uses: actions/github-script@v7
id: environment
with:
script: return '${{ matrix.cluster }}'.split('-')[1]
result-encoding: string

- name: Get resource group name
uses: actions/github-script@v6
uses: actions/github-script@v7
id: resource-group
with:
script: return 'rg-aks-${{ steps.environment.outputs.result }}'
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/MD.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,15 @@ on:
default: 'warning'
type: choice
options:
- afk-no
- bfk-no
- fintlabs-no
- innlandetfylke-no
- mrfylke-no
- nfk-no
- ofk-no
- tfk-no
- vfk-no
- viken-no
- vlfk-no
- trondelagfylke-no
Expand All @@ -40,7 +45,7 @@ jobs:
packages: write

steps:
- uses: actions/github-script@v6
- uses: actions/github-script@v7
name: Get resource group name
id: rg
with:
Expand All @@ -49,15 +54,15 @@ jobs:
return `rg-${a[0]}-${a[1]}`
result-encoding: string

- uses: actions/github-script@v6
- uses: actions/github-script@v7
name: Get environment
id: environment
with:
script: |
const a = '${{ inputs.cluster }}'.split('-')
return `${a[1]}`
result-encoding: string
- uses: actions/github-script@v6
- uses: actions/github-script@v7
name: Get auth
id: auth
with:
Expand Down

0 comments on commit 7cc6b75

Please sign in to comment.