Skip to content

Commit ddcc0bf

Browse files
authored
Add Volto 19 demo with subpath feature on demo.plone.org/next (#91)
* Add Volto 19 demo with subpath feature on demo.plone.org/next * Pass RAZZLE_SUBPATH_PREFIX to image build * Update
1 parent bc2272d commit ddcc0bf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+29452
-3
lines changed

.github/workflows/frontend.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ on:
2424
build-dir:
2525
type: string
2626
default: frontend
27+
subpath-prefix:
28+
type: string
29+
default: ""
2730

2831
defaults:
2932
run:
@@ -97,7 +100,6 @@ jobs:
97100
packages: write
98101

99102
steps:
100-
101103
- name: Checkout
102104
uses: actions/checkout@v4
103105

@@ -109,8 +111,7 @@ jobs:
109111
${{ inputs.image-name-prefix }}-${{ inputs.image-name-suffix }}
110112
labels: |
111113
org.label-schema.docker.cmd=docker run -d -p 8080:8080 ${{ inputs.image-name-prefix }}-${{ inputs.image-name-suffix }}:${{ inputs.base-tag }}
112-
flavor:
113-
latest=false
114+
flavor: latest=false
114115
tags: |
115116
type=ref,event=branch
116117
type=sha
@@ -141,3 +142,4 @@ jobs:
141142
labels: ${{ steps.meta.outputs.labels }}
142143
build-args: |
143144
VOLTO_VERSION=${{ inputs.volto-version }}
145+
RAZZLE_SUBPATH_PREFIX=${{ inputs.subpath-prefix }}

.github/workflows/next.yml

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
name: demo.plone.org/next build and deploy demo
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- "frontend-next/**"
9+
- ".github/workflows/frontend.yml"
10+
- ".github/workflows/next.yml"
11+
- "devops/stacks/demo.plone.org_next.yml"
12+
workflow_dispatch:
13+
14+
env:
15+
IMAGE_NAME_PREFIX: ghcr.io/plone/demo-next
16+
NODE_VERSION: "24.x"
17+
PYTHON_VERSION: "3.12"
18+
19+
jobs:
20+
config:
21+
runs-on: ubuntu-latest
22+
outputs:
23+
backend: ${{ steps.filter.outputs.backend }}
24+
frontend: ${{ steps.filter.outputs.frontend }}
25+
BASE_TAG: ${{ steps.vars.outputs.BASE_TAG }}
26+
IMAGE_NAME_PREFIX: ${{ env.IMAGE_NAME_PREFIX }}
27+
NODE_VERSION: ${{ env.NODE_VERSION }}
28+
PYTHON_VERSION: ${{ env.PYTHON_VERSION }}
29+
PLONE_VERSION: ${{ steps.vars.outputs.PLONE_VERSION }}
30+
VOLTO_VERSION: ${{ steps.vars.outputs.VOLTO_VERSION }}
31+
steps:
32+
- name: Checkout
33+
uses: actions/checkout@v4
34+
35+
- name: Compute several vars needed for the CI
36+
id: vars
37+
run: |
38+
echo "BASE_TAG=sha-$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
39+
echo "PLONE_VERSION=$(cat backend/version.txt)" >> $GITHUB_OUTPUT
40+
python3 -c 'import json; data = json.load(open("./frontend/mrs.developer.json")); print("VOLTO_VERSION=" + (data["core"].get("tag") or "latest"))' >> $GITHUB_OUTPUT
41+
42+
# - uses: dorny/paths-filter@v3
43+
# id: filter
44+
# with:
45+
# base: scaffold_update
46+
# filters: |
47+
# backend:
48+
# - 'backend-volto/**'
49+
# - '.github/workflows/backend.yml'
50+
# frontend:
51+
# - 'frontend-next/**'
52+
# - '.github/workflows/frontend.yml'
53+
54+
- name: Test vars
55+
run: |
56+
echo 'BASE_TAG=${{ steps.vars.outputs.BASE_TAG }}'
57+
echo 'PLONE_VERSION=${{ steps.vars.outputs.PLONE_VERSION }}'
58+
echo 'VOLTO_VERSION=${{ steps.vars.outputs.VOLTO_VERSION }}'
59+
# echo 'backend: ${{ steps.filter.outputs.backend }}'
60+
echo 'frontend: ${{ steps.filter.outputs.frontend }}'
61+
62+
# backend:
63+
# uses: ./.github/workflows/backend.yml
64+
# needs:
65+
# - config
66+
# with:
67+
# base-tag: ${{ needs.config.outputs.BASE_TAG }}
68+
# image-name-prefix: ${{ needs.config.outputs.IMAGE_NAME_PREFIX }}
69+
# image-name-suffix: backend
70+
# python-version: ${{ needs.config.outputs.PYTHON_VERSION }}
71+
# plone-version: ${{ needs.config.outputs.PLONE_VERSION }}
72+
# if: ${{ needs.config.outputs.backend == 'true' }}
73+
# permissions:
74+
# contents: read
75+
# packages: write
76+
77+
frontend:
78+
uses: ./.github/workflows/frontend.yml
79+
needs:
80+
- config
81+
with:
82+
base-tag: ${{ needs.config.outputs.BASE_TAG }}
83+
image-name-prefix: ${{ needs.config.outputs.IMAGE_NAME_PREFIX }}
84+
image-name-suffix: frontend
85+
node-version: ${{ needs.config.outputs.NODE_VERSION }}
86+
volto-version: ${{ needs.config.outputs.VOLTO_VERSION }}
87+
build-dir: frontend-next/
88+
docker-file: Dockerfile
89+
# if: ${{ needs.config.outputs.frontend == 'true' }}
90+
permissions:
91+
contents: read
92+
packages: write
93+
94+
deploy:
95+
runs-on: ubuntu-latest
96+
# this is overcomplicated for now, but allows us to re'add a custom backend again later
97+
#if: ${{ always() && github.event_name != 'pull_request' && github.ref == 'refs/heads/main' && !contains(needs.*.result, 'failure') }}
98+
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main'
99+
needs: [config, frontend]
100+
steps:
101+
- name: Checkout
102+
uses: actions/checkout@v4
103+
104+
- name: Deploy to cluster
105+
uses: kitconcept/docker-stack-deploy@v1.2.0
106+
with:
107+
registry: "ghcr.io"
108+
username: ${{ github.actor }}
109+
password: ${{ secrets.DEPLOY_GHCR_READ_TOKEN }}
110+
remote_host: ${{ vars.DEPLOY_HOST }}
111+
remote_port: ${{ vars.DEPLOY_PORT }}
112+
remote_user: ${{ vars.DEPLOY_USER }}
113+
remote_private_key: ${{ secrets.DEPLOY_SSH }}
114+
stack_file: devops/stacks/demo.plone.org_next.yml
115+
stack_name: demo-plone-org-next
116+
stack_param: latest
117+
# env_file: |
118+
# DB_PASSWORD="not used"
119+
deploy_timeout: 480
120+
121+
report:
122+
name: "Final report"
123+
if: ${{ always() }}
124+
runs-on: ubuntu-latest
125+
needs:
126+
- config
127+
- frontend
128+
- deploy
129+
steps:
130+
- name: Write report
131+
run: |
132+
echo '# Workflow Report' >> $GITHUB_STEP_SUMMARY
133+
echo '| Job ID | Conclusion |' >> $GITHUB_STEP_SUMMARY
134+
echo '| --- | --- |' >> $GITHUB_STEP_SUMMARY
135+
echo '| config | ${{ needs.config.result }} |' >> $GITHUB_STEP_SUMMARY
136+
# echo '| backend | ${{ needs.backend.result }} |' >> $GITHUB_STEP_SUMMARY
137+
echo '| frontend | ${{ needs.frontend.result }} |' >> $GITHUB_STEP_SUMMARY

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 2026-03-04
2+
3+
- Add Volto 19 demo on demo.plone.org/next. @davisagli
4+
15
# 2026-02-09
26

37
- Update to Plone 6.1.4, Volto 18.32.1, and Volto Light Theme 7.7.0. @mauritsvanrees @davisagli
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
version: "3.8"
3+
4+
services:
5+
frontend:
6+
image: ghcr.io/plone/demo-next-frontend:${STACK_PARAM:-latest}
7+
environment:
8+
RAZZLE_INTERNAL_API_PATH: http://demo-plone-org_backend:8080/Plone
9+
RAZZLE_SUBPATH_PREFIX: /next
10+
networks:
11+
- demoplone
12+
- public
13+
deploy:
14+
replicas: 1
15+
update_config:
16+
parallelism: 1
17+
delay: 5s
18+
order: start-first
19+
labels:
20+
- traefik.enable=true
21+
- traefik.docker.network=public
22+
- traefik.constraint-label=public
23+
# Service
24+
- traefik.http.services.svc-demo-next-frontend.loadbalancer.server.port=3000
25+
# Routers
26+
## /
27+
- traefik.http.routers.rt-demo-next-frontend.rule=Host(`demo.plone.org`) && PathPrefix(`/next`)
28+
- traefik.http.routers.rt-demo-next-frontend.entrypoints=https
29+
- traefik.http.routers.rt-demo-next-frontend.tls=true
30+
- traefik.http.routers.rt-demo-next-frontend.tls.certresolver=le
31+
- traefik.http.routers.rt-demo-next-frontend.service=svc-demo-next-frontend
32+
- traefik.http.routers.rt-demo-next-frontend.middlewares=gzip
33+
- traefik.http.routers.rt-demo-next-frontend.priority=100
34+
35+
networks:
36+
public:
37+
external: true
38+
name: public
39+
demoplone:
40+
internal: true
41+
driver: overlay

frontend-next/.eslintrc.js

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
const fs = require('fs');
2+
const projectRootPath = __dirname;
3+
const { AddonRegistry } = require('@plone/registry/addon-registry');
4+
5+
let coreLocation;
6+
if (fs.existsSync(`${projectRootPath}/core`))
7+
coreLocation = `${projectRootPath}/core`;
8+
else if (fs.existsSync(`${projectRootPath}/../../core`))
9+
coreLocation = `${projectRootPath}/../../core`;
10+
11+
const { registry } = AddonRegistry.init(`${coreLocation}/packages/volto`);
12+
13+
// Extends ESlint configuration for adding the aliases to `src` directories in Volto addons
14+
const addonAliases = Object.keys(registry.packages).map((o) => [
15+
o,
16+
registry.packages[o].modulePath,
17+
]);
18+
19+
module.exports = {
20+
extends: `${coreLocation}/packages/volto/.eslintrc`,
21+
rules: {
22+
'import/no-unresolved': 1,
23+
},
24+
settings: {
25+
'import/resolver': {
26+
alias: {
27+
map: [
28+
['@plone/volto', `${coreLocation}/packages/volto/src`],
29+
['@plone/volto-slate', `${coreLocation}/packages/volto-slate/src`],
30+
['@plone/registry', `${coreLocation}/packages/registry/src`],
31+
[
32+
'frontend-next',
33+
'./packages/frontend-next/src',
34+
],
35+
...addonAliases,
36+
],
37+
extensions: ['.js', '.jsx', '.ts', '.tsx', '.json'],
38+
},
39+
},
40+
},
41+
};
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: Acceptance tests
2+
on:
3+
push:
4+
paths:
5+
- "*.js"
6+
- "*.json"
7+
- "*.yaml"
8+
- "cypress/**"
9+
- "packages/**"
10+
- ".github/workflows/acceptance.yml"
11+
12+
env:
13+
NODE_VERSION: 24
14+
CYPRESS_RETRIES: 2
15+
16+
jobs:
17+
18+
acceptance:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- name: Use Node.js ${{ env.NODE_VERSION }}
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version: ${{ env.NODE_VERSION }}
27+
28+
- name: Enable corepack
29+
run: npm i -g corepack@latest && corepack enable
30+
31+
- name: Get pnpm store directory
32+
shell: bash
33+
run: |
34+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
35+
36+
- uses: actions/cache@v4
37+
name: Setup pnpm cache
38+
with:
39+
path: ${{ env.STORE_PATH }}
40+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
41+
restore-keys: |
42+
${{ runner.os }}-pnpm-store-
43+
44+
- name: Cache Cypress Binary
45+
id: cache-cypress-binary
46+
uses: actions/cache@v4
47+
with:
48+
path: ~/.cache/Cypress
49+
key: binary-${{ env.NODE_VERSION }}-${{ hashFiles('pnpm-lock.yaml') }}
50+
51+
- name: Install dependencies
52+
run: make install
53+
54+
- name: Install Cypress if not in cache
55+
if: steps.cache-cypress-binary.outputs.cache-hit != 'true'
56+
working-directory: core/packages/volto
57+
run: make cypress-install
58+
59+
- uses: JarvusInnovations/background-action@v1
60+
name: Start Servers
61+
with:
62+
run: |
63+
make ci-acceptance-backend-start &
64+
make acceptance-frontend-prod-start &
65+
# your step-level and job-level environment variables are available to your commands as-is
66+
# npm install will count towards the wait-for timeout
67+
# whenever possible, move unrelated scripts to a different step
68+
# to background multiple processes: add & to the end of the command
69+
70+
wait-on: |
71+
http-get://localhost:55001/plone
72+
http://localhost:3000
73+
# IMPORTANT: to use environment variables in wait-on, you must use this form: ${{ env.VAR }}
74+
# See wait-on section below for all resource types and prefixes
75+
76+
tail: true # true = stderr,stdout
77+
# This will allow you to monitor the progress live
78+
79+
log-output-resume: stderr
80+
# Eliminates previosuly output stderr log entries from post-run output
81+
82+
wait-for: 10m
83+
84+
log-output: stderr,stdout # same as true
85+
86+
log-output-if: failure
87+
88+
- run: make ci-acceptance-test
89+
90+
# Upload Cypress screenshots
91+
- uses: actions/upload-artifact@v4
92+
if: failure()
93+
with:
94+
name: cypress-screenshots-acceptance
95+
path: acceptance/cypress/screenshots
96+
97+
# Upload Cypress videos
98+
- uses: actions/upload-artifact@v4
99+
if: failure()
100+
with:
101+
name: cypress-videos-acceptance
102+
path: acceptance/cypress/videos

0 commit comments

Comments
 (0)