Unverified Commit 2aabc9b6 authored by Denis_P's avatar Denis_P 🏑 Committed by GitHub
Browse files

Docs generating (#318)

* test gen docs

* done!
parent 3f83a7c4
Pipeline #79307 failed with stages
in 5 minutes and 49 seconds
...@@ -13,7 +13,7 @@ stages: ...@@ -13,7 +13,7 @@ stages:
variables: variables:
GIT_STRATEGY: fetch GIT_STRATEGY: fetch
GIT_DEPTH: "3" GIT_DEPTH: 3
CARGO_HOME: "/ci-cache/${CI_PROJECT_NAME}/cargo/${CI_JOB_NAME}" CARGO_HOME: "/ci-cache/${CI_PROJECT_NAME}/cargo/${CI_JOB_NAME}"
CARGO_TARGET_DIR: "/ci-cache/${CI_PROJECT_NAME}/targets/${CI_COMMIT_REF_NAME}/${CI_JOB_NAME}" CARGO_TARGET_DIR: "/ci-cache/${CI_PROJECT_NAME}/targets/${CI_COMMIT_REF_NAME}/${CI_JOB_NAME}"
CI_SERVER_NAME: "GitLab CI" CI_SERVER_NAME: "GitLab CI"
...@@ -202,22 +202,31 @@ examples-generate-metadata: ...@@ -202,22 +202,31 @@ examples-generate-metadata:
publish-docs: publish-docs:
stage: publish stage: publish
<<: *docker-env <<: *docker-env
variables:
GIT_DEPTH: 0
only: only:
- master - master
- schedules - schedules
- tags - tags
script: script:
- rm -rf /tmp/*
- unset CARGO_TARGET_DIR
# Set github # Set github
- git config --global user.email "devops-team@parity.io" - git config --global user.email "devops-team@parity.io"
- git config --global user.name "${GITHUB_USER}" - git config --global user.name "${GITHUB_USER}"
- git config remote.origin.url "https://${GITHUB_TOKEN}@github.com/paritytech/ink.git" - git config remote.origin.url "https://${GITHUB_TOKEN}@github.com/paritytech/ink.git"
# Generating Docs # Generating Docs
- cargo doc --no-deps --all - time cargo doc --release --no-deps --all --verbose
# saving README and docs
- mv target/doc/ /tmp/
- cp README.md /tmp/doc/
# on gh-pages branch the contents of target/doc should be in root dir
- git checkout -b gh-pages || git checkout gh-pages - git checkout -b gh-pages || git checkout gh-pages
# Symbolic link because these files live in cache - mv _config.yml /tmp/doc/
- mkdir -p target/doc # remove everything and restore generated docs, README and Jekyll config
- ln -s "${CARGO_TARGET_DIR}"/doc/ target/doc/ - rm -vrf ./*
- mv /tmp/doc/* .
# Upload files # Upload files
- git add -f target/doc/ - git add --all --force
- git commit -m "Update docs to ${CI_COMMIT_REF_NAME}" - git commit -m "Updated docs for ${CI_COMMIT_REF_NAME} and pushed to gh-pages"
- git push origin gh-pages --force - git push origin gh-pages --force
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment