Skip to content

Commit

Permalink
Use Docker Compose to build docs and clean up project root
Browse files Browse the repository at this point in the history
  • Loading branch information
clue committed Dec 13, 2024
1 parent 39fac5e commit 186bafe
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 5 deletions.
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
/.github/workflows/ export-ignore
/.gitignore export-ignore
/docs/ export-ignore
/mkdocs.yml export-ignore
/phpstan.neon.dist export-ignore
/phpunit.xml.dist export-ignore
/phpunit.xml.legacy export-ignore
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -219,3 +219,11 @@ jobs:
- run: php -S localhost:8080 tests/integration/public/index.php &
- run: bash tests/await.bash
- run: bash tests/integration.bash

Docs:
name: Docs
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- run: docker compose -f docs/compose.yaml run build
- run: ls -la build/docs/
8 changes: 4 additions & 4 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ If you want to contribute to the documentation, it's easiest to just run
this in a Docker container in the project root directory like this:

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

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

```bash
$ docker run --rm -it -v ${PWD}:/docs squidfunk/mkdocs-material:8.1.3 build
docker compose -f docs/compose.yaml run build
```

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

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

Happy hacking!
18 changes: 18 additions & 0 deletions docs/compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
services:
mkdocs:
image: squidfunk/mkdocs-material:8.1.3
command: serve -a 0.0.0.0:8000
ports:
- ${PORT:-8000}:8000
working_dir: /project/
volumes:
- ./mkdocs.yml:/project/mkdocs.yml:ro
- ./:/project/docs/:ro

build:
extends: mkdocs
command: build
volumes:
- ../build/:/project/build/:rw
profiles:
- build
File renamed without changes.

0 comments on commit 186bafe

Please sign in to comment.