From 1c7da922b9f81971c04eccefcfb6242d1c9eeaf1 Mon Sep 17 00:00:00 2001
From: Frederik Hennig <frederik.hennig@fau.de>
Date: Wed, 22 Nov 2023 15:11:24 +0900
Subject: [PATCH] publish docs to gitlab-pages

---
 .gitignore     |  4 ++++
 .gitlab-ci.yml | 28 ++++++++++++++++++++++++++++
 docs/index.md  | 10 +++++-----
 3 files changed, 37 insertions(+), 5 deletions(-)

diff --git a/.gitignore b/.gitignore
index 6bccaae..6cd14d7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -16,3 +16,7 @@ dist
 *.tar.gz
 *.whl
 *.egg-info
+
+
+#   mkdocs
+site
\ No newline at end of file
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 3922c6d..76399dc 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,5 +1,7 @@
 stages:
   - pretest
+  - test
+  - deploy
 
 linter:
   stage: pretest
@@ -23,3 +25,29 @@ typechecker:
     - mypy src/pystencilssfg 
   tags:
     - docker
+
+build-documentation:
+  stage: test
+  image: i10git.cs.fau.de:5005/pycodegen/pycodegen/documentation
+  script:
+    - pip install mkdocs mkdocs-material mkdocstrings[python]
+    - mkdocs build
+  tags:
+    - docker
+  artifacts:
+    paths:
+      - site
+
+pages:
+  image: i10git.cs.fau.de:5005/pycodegen/pycodegen/full
+  stage: deploy
+  script:
+    - ls -l
+    - mv site public  # folder has to be named "public" for gitlab to publish it
+  artifacts:
+    paths:
+      - public
+  tags:
+    - docker
+  only:
+    - master@da15siwa/pystencils-sfg
diff --git a/docs/index.md b/docs/index.md
index e830190..1b057a3 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -10,10 +10,10 @@ and your C/C++/Cuda/HIP framework.
 Clone the [repository](https://i10git.cs.fau.de/da15siwa/pystencils-sfg) and install the package into your current Python environment
 (usage of virtual environments is strongly encouraged!):
 
-```shell
-$ git clone https://i10git.cs.fau.de/da15siwa/pystencils-sfg.git
-$ cd pystencils-sfg
-$ pip install .
+```bash
+git clone https://i10git.cs.fau.de/da15siwa/pystencils-sfg.git
+cd pystencils-sfg
+pip install .
 ```
 
 ### From PyPI
@@ -55,7 +55,7 @@ with SourceFileGenerator() as sfg:
 Take this code, store it into a file `poisson_smoother.py`, and enter the magic words into a terminal:
 
 ```shell
-$ python poisson_smoother.py
+python poisson_smoother.py
 ```
 
 This command will execute the code generator through the `SourceFileGenerator` context manager.
-- 
GitLab