diff --git a/.gitattributes b/.gitattributes index bc66380..de49d99 100644 --- a/.gitattributes +++ b/.gitattributes @@ -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 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7541cfc..d3b7820 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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/ diff --git a/docs/README.md b/docs/README.md index d885cec..bfcaa73 100644 --- a/docs/README.md +++ b/docs/README.md @@ -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`. @@ -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! diff --git a/docs/compose.yaml b/docs/compose.yaml new file mode 100644 index 0000000..6a68cdb --- /dev/null +++ b/docs/compose.yaml @@ -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 diff --git a/mkdocs.yml b/docs/mkdocs.yml similarity index 100% rename from mkdocs.yml rename to docs/mkdocs.yml