-
Notifications
You must be signed in to change notification settings - Fork 58
176 lines (158 loc) · 5.01 KB
/
aro-hcp-cd.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
---
name: ARO HCP Continuous Deployment
env:
DEPLOY_ENV: dev
PERSIST: true
SKIP_CONFIRM: true
on:
workflow_dispatch:
pull_request:
branches:
- main
paths:
- '.github/workflows/aro-hcp-cd.yml'
- '.github/workflows/environment-infra-cd.yml'
- '.github/workflows/services-cd.yml'
- '.github/workflows/services-ci.yml'
- 'config/config.yaml'
- 'dev-infrastructure/**/*.bicep'
- 'dev-infrastructure/**/*.bicepparam'
- 'dev-infrastructure/configurations/*'
- 'frontend/**'
- 'backend/**'
- 'cluster-service/**'
- 'internal/**'
- 'maestro/**'
- 'pko/**'
- 'acm/**'
- 'hypershiftoperator/**'
- 'image-sync/**/'
- 'tooling/image-sync/**'
- 'tooling/templatize/**'
- 'config/*'
types:
- opened
- synchronize
- reopened
- closed
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: false
jobs:
deploy_global_rg:
name: 'Deploy global resources'
if: github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch'
permissions:
id-token: 'write'
contents: 'read'
env:
DEPLOY_ENV: dev
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 1
- name: "install azure-cli"
uses: "Azure/ARO-HCP@main"
- name: 'Az CLI login'
uses: azure/login@a65d910e8af852a8061c627c456678983e180302 # v2.2.0
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- name: 'Deploy'
run: |
cd dev-infrastructure/
# Manage ACR
make acr acr-svc-cfg acr-ocp-cfg
# Setup operator roles for platform workload identity
make operator-roles
deploy_image_sync_rg:
name: 'Deploy Image Sync'
if: github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch'
needs:
- deploy_global_rg
permissions:
id-token: 'write'
contents: 'read'
env:
DEPLOY_ENV: dev
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 1
- name: "install azure-cli"
uses: "Azure/ARO-HCP@main"
- name: 'Az CLI login'
uses: azure/login@a65d910e8af852a8061c627c456678983e180302 # v2.2.0
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- name: 'Deploy'
run: |
cd dev-infrastructure/
make imagesync
service_ci:
name: 'Build service images'
permissions:
id-token: 'write'
contents: 'read'
secrets: inherit
uses: ./.github/workflows/services-ci.yml
with:
push: ${{ github.event.pull_request.merged == true }}
deploy_dev_environment_infra:
name: 'Deploy integrated DEV infrastructure'
if: github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch'
needs:
- deploy_global_rg
permissions:
id-token: 'write'
contents: 'read'
secrets: inherit
uses: ./.github/workflows/environment-infra-cd.yml
with:
deploy_env: dev
deploy_dev_environment_services:
name: 'Deploy services to integrated DEV'
if: github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch'
needs:
- service_ci
- deploy_dev_environment_infra
permissions:
id-token: 'write'
contents: 'read'
secrets: inherit
uses: ./.github/workflows/services-cd.yml
with:
deploy_env: dev
# CS PR env deployment disabled during testing
deploy_cs_pr_environment_infra:
name: 'Deploy CS PR infrastructure'
if: github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch'
needs:
- deploy_global_rg
permissions:
id-token: 'write'
contents: 'read'
secrets: inherit
uses: ./.github/workflows/environment-infra-cd.yml
with:
deploy_env: cs-pr
deploy_cs_pr_check_deps: true
deploy_cs_pr_environment_services:
name: 'Deploy services to CS PR'
if: github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch'
needs:
- service_ci
- deploy_cs_pr_environment_infra
permissions:
id-token: 'write'
contents: 'read'
secrets: inherit
uses: ./.github/workflows/services-cd.yml
with:
deploy_env: cs-pr
deploy_cs_pr_check_deps: true