]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
gitlab-ci: push docs to the website (manual CI) docs-develop-webs-khkalp/deployments/3739
authorOto Šťáva <oto.stava@nic.cz>
Wed, 10 Apr 2024 10:43:11 +0000 (12:43 +0200)
committerOto Šťáva <oto.stava@nic.cz>
Wed, 10 Apr 2024 12:55:37 +0000 (14:55 +0200)
.gitlab-ci.yml

index 475cf3c8643556518b6f596fcf7c24e002e70eac..66e63419e7be9084bcaf5d6a6147543cd89876c6 100644 (file)
@@ -817,4 +817,22 @@ docs:release:
     name: docs-release/$CI_COMMIT_TAG
     url: https://$CI_PROJECT_NAMESPACE.pages.nic.cz/-/knot-resolver/-/jobs/$CI_JOB_ID/artifacts/doc/html/index.html
 
+# This job pushes the Knot Resolver documentation into a new branch of the
+# `websites/knot-resolver.cz` repository.
+docs:website:
+  stage: deploy
+  needs:
+    - docs:build
+  when: manual
+  variables:
+  script:
+    - "SRC_COMMIT_REF=\"$CI_COMMIT_TAG$CI_COMMIT_BRANCH$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME\""
+    - "git clone \"https://gitlab-ci-token:$WEBSITE_DOCS_CI_TOKEN@$CI_SERVER_HOST:$CI_SERVER_PORT/websites/knot-resolver.cz.git\" website"
+    - "cp --recursive --verbose \"doc/html\" \"website/content/documentation/$SRC_COMMIT_REF\""
+    - cd website
+    - "git checkout -b \"docs/$SRC_COMMIT_REF\""
+    - "git add \"content/documentation/$SRC_COMMIT_REF\""
+    - "git commit -m \"docs: $SRC_COMMIT_REF\""
+    - "git push --force --set-upstream origin \"docs/$SRC_COMMIT_REF\""
+
 # }}}