-
Notifications
You must be signed in to change notification settings - Fork 1
214 lines (207 loc) · 8.92 KB
/
Copy pathconfig.yml
File metadata and controls
214 lines (207 loc) · 8.92 KB
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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
name: "kitconcept-intranet: Compute Config variables"
on:
workflow_call:
inputs:
hostname:
required: false
type: string
default: "plone-intranet.kitconcept.dev"
certresolver:
required: false
type: string
default: "le-cloudflare"
stack-prefix:
required: false
type: string
default: "kc-intranet-dev"
image-name-prefix:
required: false
type: string
default: "ghcr.io/kitconcept/kitconcept-intranet"
node-version:
required: false
type: string
default: "24.x"
python-version:
required: false
type: string
default: "3.14"
outputs:
acceptance:
description: "Flag reporting if we should run the acceptance jobs"
value: ${{ jobs.config.outputs.acceptance }}
backend:
description: "Flag reporting if we should run the backend jobs"
value: ${{ jobs.config.outputs.backend }}
devops:
description: "Flag reporting if we should run the devops jobs"
value: ${{ jobs.config.outputs.devops }}
docs:
description: "Flag reporting if we should run the docs jobs"
value: ${{ jobs.config.outputs.docs }}
frontend:
description: "Flag reporting if we should run the frontend jobs"
value: ${{ jobs.config.outputs.frontend }}
deploy:
description: "Flag reporting if we should deploy"
value: ${{ jobs.config.outputs.deploy }}
base-tag:
description: "Base tag to be used when creating container images"
value: ${{ jobs.config.outputs.base-tag }}
image-name-prefix:
description: "Image name prefix for container images"
value: ${{ jobs.config.outputs.image-name-prefix }}
node-version:
description: "Node version to be used"
value: ${{ inputs.node-version }}
python-version:
description: "Python version to be used"
value: ${{ inputs.python-version }}
kc-version:
description: "kitconcept-core version to be used"
value: ${{ jobs.config.outputs.kc-version }}
volto-version:
description: "Volto version to be used"
value: ${{ jobs.config.outputs.volto-version }}
hostname:
description: "Deploy: Hostname to be used for the site"
value: ${{ inputs.hostname }}
certresolver:
description: "Certresolver to be used"
value: ${{ inputs.certresolver }}
environment:
description: "Deploy: Environment used to get secrets and variables from."
value: ${{ jobs.config.outputs.environment }}
stack-name:
description: "Deploy: Name of the Docker stack to be used"
value: ${{ jobs.config.outputs.stack-name }}
stack-prefix:
description: "Deploy: Short name to be used to create Traefik labels"
value: ${{ inputs.stack-prefix }}
changelog-backend:
description: "Flag reporting if we should run changelog jobs for the backend"
value: ${{ jobs.config.outputs.changelog-backend }}
changelog-frontend:
description: "Flag reporting if we should run changelog jobs for the frontend"
value: ${{ jobs.config.outputs.changelog-frontend }}
changelog-repository:
description: "Flag reporting if we should run changelog jobs for the repository"
value: ${{ jobs.config.outputs.changelog-repository }}
path-backend:
description: "Path to the backend package, relative to the repository root"
value: ${{ jobs.config.outputs.path-backend }}
path-frontend:
description: "Path to the frontend package, relative to the repository root"
value: ${{ jobs.config.outputs.path-frontend }}
path-root:
description: "Path to the repository root"
value: ${{ jobs.config.outputs.path-root }}
jobs:
config:
runs-on: ubuntu-latest
outputs:
acceptance: ${{ steps.filter.outputs.acceptance }}
backend: ${{ steps.filter.outputs.backend }}
devops: ${{ steps.filter.outputs.devops }}
docs: ${{ steps.filter.outputs.docs }}
frontend: ${{ steps.filter.outputs.frontend }}
deploy: ${{ steps.filter.outputs.deploy }}
base-tag: ${{ steps.vars.outputs.base-tag }}
kc-version: ${{ steps.vars.outputs.kc-version }}
volto-version: ${{ steps.vars.outputs.volto-version }}
environment: ${{ steps.vars.outputs.environment }}
stack-name: ${{ steps.vars.outputs.stack-name }}
image-name-prefix: ${{ steps.vars.outputs.image-name-prefix }}
changelog-backend: ${{ steps.filter.outputs.changelog-backend }}
changelog-frontend: ${{ steps.filter.outputs.changelog-frontend }}
changelog-repository: ${{ steps.filter.outputs.changelog-repository }}
path-backend: ${{ steps.vars.outputs.path-backend }}
path-frontend: ${{ steps.vars.outputs.path-frontend }}
path-root: ${{ steps.vars.outputs.path-root }}
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Setup uv
uses: plone/meta/.github/actions/setup_uv@2.x
with:
python-version: ${{ inputs.python-version }}
working-directory: '.'
- name: Compute several vars needed for the CI
id: vars
run: |
REPOSITORY_SETTINGS="$(uvx repoplone settings dump)"
# `repoplone` reports absolute paths, but the checks need them
# relative to the repository root.
ROOT="$(jq -r '.root_path' <<< "$REPOSITORY_SETTINGS")"
echo "base-tag=sha-$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"
echo "image-name-prefix=$(jq -r '.container_images_prefix' <<< "$REPOSITORY_SETTINGS")" >> "$GITHUB_OUTPUT"
echo "kc-version=$(jq -r '.backend.base_package_version' <<< "$REPOSITORY_SETTINGS")" >> "$GITHUB_OUTPUT"
echo "volto-version=$(jq -r '.frontend.volto_version' <<< "$REPOSITORY_SETTINGS")" >> "$GITHUB_OUTPUT"
echo "path-backend=$(jq -r '.backend.path' <<< "$REPOSITORY_SETTINGS" | sed "s|^${ROOT}/||")" >> "$GITHUB_OUTPUT"
echo "path-frontend=$(jq -r '.frontend.path' <<< "$REPOSITORY_SETTINGS" | sed "s|^${ROOT}/||")" >> "$GITHUB_OUTPUT"
echo "path-root=." >> "$GITHUB_OUTPUT"
environment=${{ inputs.hostname }}
echo "environment=${environment}" >> $GITHUB_OUTPUT
echo "stack-name=${environment//./-}" >> $GITHUB_OUTPUT
- uses: dorny/paths-filter@v4.0.3
id: filter
with:
filters: |
acceptance:
- '.github/workflows/*'
- 'backend/**'
- 'frontend/**'
- 'docker-compose-*.yml'
backend:
- 'backend/**'
- '.github/workflows/backend*'
- '.github/workflows/main*'
- 'docker-compose-*.yml'
devops:
- 'devops/**'
docs:
- '.readthedocs.yaml'
- 'docs/**'
- '.github/workflows/docs.yaml'
frontend:
- 'frontend/**'
- '.github/workflows/frontend*'
- '.github/workflows/main*'
deploy:
- 'backend/**'
- 'frontend/**'
- '.github/workflows/backend*'
- '.github/workflows/frontend*'
- '.github/workflows/main*'
- 'devops/**'
changelog-backend:
- 'backend/**'
changelog-frontend:
- 'frontend/**'
changelog-repository:
- '.github/**'
- '.vscode/**'
- 'devops/**'
- 'docs/**'
- 'docker-compose.yml'
- 'README.md'
- name: Test vars
run: |
echo "BASE_TAG: ${{ steps.vars.outputs.base-tag }}"
echo 'kc-version: ${{ steps.vars.outputs.kc-version }}'
echo 'volto-version: ${{ steps.vars.outputs.volto-version }}'
echo 'path-backend: ${{ steps.vars.outputs.path-backend }}'
echo 'path-frontend: ${{ steps.vars.outputs.path-frontend }}'
echo 'path-root: ${{ steps.vars.outputs.path-root }}'
echo 'environment: ${{ steps.vars.outputs.environment }}'
echo 'stack-name: ${{ steps.vars.outputs.stack-name }}'
echo 'event-name: ${{ github.event_name }}'
echo "ref-name: ${{ github.ref_name }}"
echo 'Paths - acceptance: ${{ steps.filter.outputs.acceptance }}'
echo 'Paths - backend: ${{ steps.filter.outputs.backend }}'
echo 'Paths - devops: ${{ steps.filter.outputs.devops }}'
echo 'Paths - docs: ${{ steps.filter.outputs.docs }}'
echo 'Paths - frontend: ${{ steps.filter.outputs.frontend }}'
echo 'Paths - changelog-backend: ${{ steps.filter.outputs.changelog-backend }}'
echo 'Paths - changelog-frontend: ${{ steps.filter.outputs.changelog-frontend }}'
echo 'Paths - changelog-repository: ${{ steps.filter.outputs.changelog-repository }}'