Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Docker Compose to build docs and clean up project root #271

Merged
merged 1 commit into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 -u $(id -u) 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.