-
Notifications
You must be signed in to change notification settings - Fork 0
234 lines (222 loc) · 8.14 KB
/
Copy pathmain.yml
File metadata and controls
234 lines (222 loc) · 8.14 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
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
name: "kitconcept.website: CI"
on:
push:
paths:
- "backend/**"
- "frontend/**"
- ".github/workflows/*.yml"
- "docker-compose*.yml"
- "devops/**"
- "repository.toml"
workflow_dispatch:
jobs:
config:
name: "Config: Compute values used in workflow"
uses: ./.github/workflows/config.yml
image-build:
name: "Image: ${{ needs.config.outputs.image-name-prefix }}-${{ matrix.suffix }}:${{ needs.config.outputs.base-tag }}"
uses: ./.github/workflows/image-build.yml
if: ${{ needs.config.outputs.acceptance == 'true' }}
strategy:
fail-fast: false
matrix:
include:
- suffix: "backend"
dockerfile: "Dockerfile"
working-directory: "backend"
build-args: |
IMAGE_TAG=${{ needs.config.outputs.base-tag }}
SEED=${{ github.run_id }}
PYTHON_VERSION=${{ needs.config.outputs.python-version }}
- suffix: "acceptance"
dockerfile: "Dockerfile.acceptance"
working-directory: "backend"
build-args: |
IMAGE_TAG=${{ needs.config.outputs.base-tag }}
SEED=${{ github.run_id }}
PYTHON_VERSION=${{ needs.config.outputs.python-version }}
- suffix: "frontend"
dockerfile: "Dockerfile"
working-directory: "frontend"
build-args: |
VOLTO_VERSION=${{ needs.config.outputs.volto-version }}
needs:
- config
with:
base-tag: ${{ needs.config.outputs.base-tag }}
image-name-prefix: ${{ needs.config.outputs.image-name-prefix }}
image-name-suffix: ${{ matrix.suffix }}
build-args: ${{ matrix.build-args }}
dockerfile: ${{ matrix.dockerfile }}
working-directory: ${{ matrix.working-directory }}
backend:
uses: ./.github/workflows/backend.yml
needs:
- config
with:
python-version: ${{ needs.config.outputs.python-version }}
kc-version: ${{ needs.config.outputs.kc-version }}
if: ${{ needs.config.outputs.backend == 'true' }}
permissions:
contents: read
packages: write
frontend:
uses: ./.github/workflows/frontend.yml
needs:
- config
with:
node-version: ${{ needs.config.outputs.node-version }}
volto-version: ${{ needs.config.outputs.volto-version }}
if: ${{ needs.config.outputs.frontend == 'true' }}
permissions:
contents: read
packages: write
acceptance:
name: "Acceptance: ${{ matrix.name }}"
uses: ./.github/workflows/acceptance.yml
if: ${{ needs.config.outputs.acceptance == 'true' }}
strategy:
fail-fast: false
matrix:
include:
- name: "Core Tests - Basic"
spec-pattern: 'core/basic/*.cy.{js,jsx,ts,tsx}'
- name: "Core Tests - Blocks"
spec-pattern: 'core/blocks/*.cy.{js,jsx,ts,tsx}'
- name: "Core Tests - Listings"
spec-pattern: 'core/blocks-listings/*.cy.{js,jsx,ts,tsx}'
- name: "Core Tests - Content"
spec-pattern: 'core/content/*.cy.{js,jsx,ts,tsx}'
- name: "Main Tests"
spec-pattern: 'main/**/*.cy.{js,jsx,ts,tsx}'
needs:
- config
- image-build
with:
base-tag: ${{ needs.config.outputs.base-tag }}
node-version: ${{ needs.config.outputs.node-version }}
name: ${{ matrix.name }}
spec-pattern: ${{ matrix.spec-pattern }}
# @sneridagh 2026-06-01: Temporarily disable a11y tests until we have in place proper
# example/demo content in place.
# a11y:
# name: "A11y: ${{ matrix.name }}"
# uses: ./.github/workflows/acceptance.yml
# if: ${{ needs.config.outputs.acceptance == 'true' }}
# strategy:
# fail-fast: false
# matrix:
# include:
# - name: "Tests"
# api-url: 'localhost:8080/plone'
# spec-pattern: 'a11y/**/*.cy.{js,jsx,ts,tsx}'
# needs:
# - config
# - image-build
# with:
# base-tag: ${{ needs.config.outputs.base-tag }}
# node-version: ${{ needs.config.outputs.node-version }}
# name: ${{ matrix.name }}
# api-url: ${{ matrix.api-url }}
# spec-pattern: ${{ matrix.spec-pattern }}
# test-profile: a11y
backend-release:
uses: ./.github/workflows/backend-release.yml
needs:
- config
- acceptance
# - a11y
- backend
with:
base-tag: ${{ needs.config.outputs.base-tag }}
image-name-prefix: ${{ needs.config.outputs.image-name-prefix }}
image-name-suffix: "backend"
python-version: ${{ needs.config.outputs.python-version }}
kc-version: ${{ needs.config.outputs.kc-version }}
if: ${{ needs.config.outputs.deploy == 'true' && (always() && !contains(needs.*.result, 'failure')) }}
permissions:
contents: read
packages: write
frontend-release:
uses: ./.github/workflows/frontend-release.yml
needs:
- config
- acceptance
# - a11y
- frontend
with:
base-tag: ${{ needs.config.outputs.base-tag }}
image-name-prefix: ${{ needs.config.outputs.image-name-prefix }}
image-name-suffix: "frontend"
node-version: ${{ needs.config.outputs.node-version }}
volto-version: ${{ needs.config.outputs.volto-version }}
if: ${{ needs.config.outputs.deploy == 'true' && (always() && !contains(needs.*.result, 'failure')) }}
permissions:
contents: read
packages: write
deploy-dev:
name: "Deploy: plone-website.kitconcept.dev"
needs:
- config
- backend-release
- frontend-release
if: ${{ always() && github.ref == 'refs/heads/main' && github.event_name != 'pull_request' && !contains(needs.*.result, 'failure') }}
uses: kitconcept/meta/.github/workflows/deploy.yml@main
with:
tag: ${{ needs.config.outputs.base-tag }}
environment: "plone-website.kitconcept.dev"
stack-name: "plone-website-kitconcept-dev"
stack-file: "devops/stacks/demo.yml"
registry: "ghcr.io"
username: ${{ github.actor }}
secrets:
password: ${{ secrets.GITHUB_TOKEN }}
remote-host: ${{ secrets.DEPLOY_HOST }}
remote-port: ${{ secrets.DEPLOY_PORT }}
remote-user: ${{ secrets.DEPLOY_USER }}
remote-private-key: ${{ secrets.DEPLOY_SSH }}
env-file: |
IMAGE_NAME_PREFIX=${{ needs.config.outputs.image-name-prefix }}
IMAGE_TAG=${{ needs.config.outputs.base-tag }}
STACK_NAME=${{ vars.STACK_NAME }}
STACK_PREFIX=${{ vars.STACK_PREFIX }}
HOSTNAME=${{ vars.HOSTNAME }}
CERTRESOLVER=${{ vars.CERTRESOLVER }}
BASIC_AUTH_USER=${{ vars.BASIC_AUTH_USER }}
BASIC_AUTH_PASSWORD=${{ vars.BASIC_AUTH_PASSWORD }}
permissions:
contents: read
packages: write
deploy-io:
name: "Deploy: plone-website.kitconcept.io"
needs:
- config
- backend-release
- frontend-release
if: ${{ always() && github.ref == 'refs/heads/main' && github.event_name != 'pull_request' && !contains(needs.*.result, 'failure') }}
uses: kitconcept/meta/.github/workflows/deploy.yml@main
with:
tag: ${{ needs.config.outputs.base-tag }}
environment: "plone-website.kitconcept.io"
stack-name: "plone-website-kitconcept-io"
stack-file: "devops/stacks/persistent.yml"
registry: "ghcr.io"
username: ${{ github.actor }}
secrets:
password: ${{ secrets.GITHUB_TOKEN }}
remote-host: ${{ secrets.DEPLOY_HOST }}
remote-port: ${{ secrets.DEPLOY_PORT }}
remote-user: ${{ secrets.DEPLOY_USER }}
remote-private-key: ${{ secrets.DEPLOY_SSH }}
env-file: |
IMAGE_NAME_PREFIX=${{ needs.config.outputs.image-name-prefix }}
IMAGE_TAG=${{ needs.config.outputs.base-tag }}
STACK_NAME=${{ vars.STACK_NAME }}
STACK_PREFIX=${{ vars.STACK_PREFIX }}
HOSTNAME=${{ vars.HOSTNAME }}
CERTRESOLVER=${{ vars.CERTRESOLVER }}
BASIC_AUTH_USER=${{ vars.BASIC_AUTH_USER }}
BASIC_AUTH_PASSWORD=${{ vars.BASIC_AUTH_PASSWORD }}
permissions:
contents: read
packages: write