From bb02f36f794bdf8e2e0614b17c7ddf376c3b8fed Mon Sep 17 00:00:00 2001
From: Karel van Klink <karel.vanklink@geant.org>
Date: Wed, 5 Jul 2023 17:48:59 +0200
Subject: [PATCH] build openAPI spec in tox step

---
 .gitlab-ci.yml      | 2 ++
 docs/.gitlab-ci.yml | 6 ++++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 6d8ff33..8fb1c78 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -35,7 +35,9 @@ run-tox-pipeline:
   script:
     - pip install tox
     - tox
+    - python docs/dump-openapi-spec.py
 
   artifacts:
     paths:
       - htmlcov
+      - docs/source/_static/openapi.json
diff --git a/docs/.gitlab-ci.yml b/docs/.gitlab-ci.yml
index 02cfc2d..221a727 100644
--- a/docs/.gitlab-ci.yml
+++ b/docs/.gitlab-ci.yml
@@ -5,10 +5,12 @@ build-documentation:
   tags:
     - docker-executor
   image: sphinxdoc/sphinx:latest
+  needs:
+    - job: run-tox-pipeline
+      artifacts: true
 
   before_script:
-    - pip install sphinx_rtd_theme fastapi
-    - python docs/dump-openapi-spec.py
+    - pip install sphinx_rtd_theme
   script:
     - sphinx-apidoc lso lso/app.py -o docs/source -d 2 -f
     - sphinx-build -b html docs/source docs/build
-- 
GitLab