Skip to content

Commit 637b17f

Browse files
committed
Merge branch '5.x' into 5.next
# Conflicts: # .github/workflows/ci.yml # docs/en/writing-migrations.rst
2 parents 21c1769 + eafc8aa commit 637b17f

31 files changed

+7194
-3189
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,13 @@ on:
77
- 4.next
88
- 5.x
99
- 5.next
10+
paths-ignore:
11+
- docs/**
1012
pull_request:
1113
branches:
1214
- '*'
15+
paths-ignore:
16+
- docs/**
1317
workflow_dispatch:
1418

1519
permissions:

.github/workflows/deploy_docs_5x.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ jobs:
2121
with:
2222
git_remote_url: 'ssh://dokku@apps.cakephp.org:22/migrations-docs-5'
2323
ssh_private_key: ${{ secrets.DOKKU_SSH_PRIVATE_KEY }}
24+
branch: '5.x'

Dockerfile

Lines changed: 36 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,36 @@
1-
# Basic docker based environment
2-
# Necessary to trick dokku into building the documentation
3-
# using dockerfile instead of herokuish
4-
FROM ubuntu:22.04
5-
6-
# Add basic tools
7-
RUN apt-get update && \
8-
apt-get install -y build-essential \
9-
software-properties-common \
10-
curl \
11-
git \
12-
libxml2 \
13-
libffi-dev \
14-
libssl-dev && \
15-
LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php && \
16-
apt-get update && \
17-
apt-get install -y php8.1-cli php8.1-mbstring php8.1-xml php8.1-zip php8.1-intl php8.1-opcache php8.1-sqlite &&\
18-
apt-get clean &&\
19-
rm -rf /var/lib/apt/lists/*
20-
21-
WORKDIR /code
22-
23-
VOLUME ["/code"]
24-
25-
CMD [ '/bin/bash' ]
1+
# ----------------------
2+
# 1. Build stage
3+
# ----------------------
4+
FROM node:22-alpine AS builder
5+
6+
# Git is required because docs/package.json pulls a dependency from GitHub.
7+
RUN apk add --no-cache git openssh-client
8+
9+
WORKDIR /app/docs
10+
11+
# Copy dependency manifests first to preserve Docker layer caching.
12+
COPY docs/ ./
13+
RUN npm ci
14+
15+
# Increase max-old-space-size to avoid memory issues during build
16+
ENV NODE_OPTIONS="--max-old-space-size=8192"
17+
18+
# Build the site.
19+
RUN npm run docs:build
20+
21+
# ----------------------
22+
# 2. Runtime stage (nginx)
23+
# ----------------------
24+
FROM nginx:1.27-alpine AS runner
25+
26+
# Copy built files
27+
COPY --from=builder /app/docs/.vitepress/dist /usr/share/nginx/html
28+
29+
# Expose port
30+
EXPOSE 80
31+
32+
# Health check (optional)
33+
HEALTHCHECK CMD wget --quiet --tries=1 --spider http://localhost:80/ || exit 1
34+
35+
# Start nginx
36+
CMD ["nginx", "-g", "daemon off;"]

docs.Dockerfile

Lines changed: 0 additions & 26 deletions
This file was deleted.

docs/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
*/public/
3+
.vitepress/cache

docs/.vitepress/config.js

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import baseConfig from '@cakephp/docs-skeleton/config'
2+
3+
import { createRequire } from "module";
4+
const require = createRequire(import.meta.url);
5+
const toc_en = require("./toc_en.json");
6+
7+
const versions = {
8+
text: "5.x",
9+
items: [
10+
{ text: "5.x (current)", link: "book.cakephp.org/migrations/5/", target: '_self' },
11+
{ text: "4.x", link: "https://book.cakephp.org/migrations/4/", target: '_self' },
12+
{ text: "3.x", link: "https://book.cakephp.org/migrations/3/", target: '_self' },
13+
{ text: "2.x", link: "https://book.cakephp.org/migrations/2/", target: '_self' },
14+
],
15+
};
16+
17+
// This file contains overrides for .vitepress/config.js
18+
export default {
19+
extends: baseConfig,
20+
srcDir: 'en',
21+
title: 'Migrations plugin',
22+
description: 'Migrations - CakePHP migrations Documentation',
23+
base: '/migrations/5/',
24+
rewrites: {
25+
"en/:slug*": ":slug*",
26+
},
27+
sitemap: {
28+
hostname: "https://book.cakephp.org/migrations/5/",
29+
},
30+
themeConfig: {
31+
socialLinks: [
32+
{ icon: "github", link: "https://github.com/cakephp/cakephp" },
33+
],
34+
editLink: {
35+
pattern: "https://github.com/cakephp/migrations/edit/5.x/docs/:path",
36+
text: "Edit this page on GitHub",
37+
},
38+
sidebar: toc_en,
39+
nav: [
40+
{ text: "CakePHP Book", link: "https://book.cakephp.org/" },
41+
{ ...versions },
42+
],
43+
},
44+
substitutions: {},
45+
locales: {
46+
root: {
47+
label: "English",
48+
lang: "en",
49+
},
50+
},
51+
};

docs/.vitepress/theme/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default } from '@cakephp/docs-skeleton'

docs/.vitepress/toc_en.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"/": [
3+
{
4+
"text": "Migrations",
5+
"collapsed": false,
6+
"items": [
7+
{ "text": "Writing Migrations", "link": "/writing-migrations" },
8+
{ "text": "Using the Query Builder", "link": "/using-the-query-builder" },
9+
{ "text": "Executing Queries", "link": "/executing-queries" },
10+
{ "text": "Database Seeding", "link": "/seeding" }
11+
]
12+
},
13+
{
14+
"text": "Upgrade Guides",
15+
"collapsed": true,
16+
"items": [
17+
{ "text": "Upgrading from 4.x to 5.x", "link": "/upgrading" },
18+
{ "text": "Upgrading to the Builtin Backend", "link": "/upgrading-to-builtin-backend" }
19+
]
20+
}
21+
]
22+
}

docs/config/__init__.py

Whitespace-only changes.

docs/config/all.py

Lines changed: 0 additions & 53 deletions
This file was deleted.

0 commit comments

Comments
 (0)