Skip to content

Commit f187da9

Browse files
committed
Use Docker Compose to build docs and clean up project root
1 parent 39fac5e commit f187da9

File tree

5 files changed

+30
-5
lines changed

5 files changed

+30
-5
lines changed

.gitattributes

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
/.github/workflows/ export-ignore
55
/.gitignore export-ignore
66
/docs/ export-ignore
7-
/mkdocs.yml export-ignore
87
/phpstan.neon.dist export-ignore
98
/phpunit.xml.dist export-ignore
109
/phpunit.xml.legacy export-ignore

.github/workflows/ci.yml

+8
Original file line numberDiff line numberDiff line change
@@ -219,3 +219,11 @@ jobs:
219219
- run: php -S localhost:8080 tests/integration/public/index.php &
220220
- run: bash tests/await.bash
221221
- run: bash tests/integration.bash
222+
223+
Docs:
224+
name: Docs
225+
runs-on: ubuntu-24.04
226+
steps:
227+
- uses: actions/checkout@v4
228+
- run: docker compose -f docs/compose.yaml run build
229+
- run: ls -la build/docs/

docs/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ If you want to contribute to the documentation, it's easiest to just run
1717
this in a Docker container in the project root directory like this:
1818

1919
```bash
20-
$ docker run --rm -it -p 8000:8000 -v ${PWD}:/docs squidfunk/mkdocs-material:8.1.3
20+
docker compose -f docs/compose.yaml up
2121
```
2222

2323
You can access the documentation via `http://localhost:8000`.
@@ -29,14 +29,14 @@ If you want to generate a static HTML folder for deployment, you can again
2929
use a Docker container in the project root directory like this:
3030

3131
```bash
32-
$ docker run --rm -it -v ${PWD}:/docs squidfunk/mkdocs-material:8.1.3 build
32+
docker compose -f docs/compose.yaml run -u $(id -u) build
3333
```
3434

3535
The resulting `build/docs/` should then be deployed behind a web server.
3636
See also the [Framework X website repository](https://github.com/clue/framework-x-website)
3737
for more details about the website itself.
3838

39-
If you want to add a new documentation file and/or change the page order, make sure the [`mkdocs.yml`](../mkdocs.yml)
40-
file in the project root directory contains an up-to-date list of all pages.
39+
If you want to add a new documentation file and/or change the page order, make sure the [`mkdocs.yml`](mkdocs.yml)
40+
file contains an up-to-date list of all pages.
4141

4242
Happy hacking!

docs/compose.yaml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
services:
2+
mkdocs:
3+
image: squidfunk/mkdocs-material:8.1.3
4+
command: serve -a 0.0.0.0:8000
5+
ports:
6+
- ${PORT:-8000}:8000
7+
working_dir: /project/
8+
volumes:
9+
- ./mkdocs.yml:/project/mkdocs.yml:ro
10+
- ./:/project/docs/:ro
11+
12+
build:
13+
extends: mkdocs
14+
command: build
15+
volumes:
16+
- ../build/:/project/build/:rw
17+
profiles:
18+
- build

mkdocs.yml docs/mkdocs.yml

File renamed without changes.

0 commit comments

Comments
 (0)