From 3cabf433bcafcccb83e36fede743102bfbcfa8dd Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Fri, 28 Jan 2022 20:09:19 +0100 Subject: [PATCH] build the user doc and publish it --- .github/workflows/docs.yml | 51 +++++++++++++++++++++++++++++++++++--- README.md | 22 +++++++++++++--- 2 files changed, 67 insertions(+), 6 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index fff4926fe..98dbd728e 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -4,12 +4,15 @@ on: push: branches: - main + pull_request: + branches: + - main schedule: - cron: "0 2 * * *" jobs: - docs: - name: generate the doc + user-docs: + name: generate the user doc runs-on: ubuntu-latest steps: - name: Checkout repository @@ -26,7 +29,48 @@ jobs: default: true profile: minimal - - name: Build Documentation + - name: Install `mdbook` + uses: actions-rs/install@v0.1 + with: + crate: mdbook + version: latest + use-tool-cache: false + env: + RUSTUP_TOOLCHAIN: stable + + - name: Build user Documentation + run: | + cd coreutils + cargo run --bin uudoc --all-features + cd docs + mdbook build + + - name: Deploy Docs + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./coreutils/docs/book/ + destination_dir: user/ + + docs: + name: generate the dev doc + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + with: + repository: uutils/coreutils + path: './coreutils' + fetch-depth: 0 + + - name: Install `rust` toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + default: true + profile: minimal + + - name: Build dev documentation run: | cd coreutils cargo doc --no-deps --all-features --workspace @@ -36,3 +80,4 @@ jobs: with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./coreutils/target/doc + destination_dir: dev/ \ No newline at end of file diff --git a/README.md b/README.md index e339157a2..cfc4becff 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,24 @@ -# coreutils-docs +# coreutils documentations -The documentation is generated daily from the https://github.com/uutils/coreutils repository. +This repository generates the user and dev documentations of https://github.com/uutils/coreutils + +## User documentation + +Can be generated with +``` +cargo run --bin uudoc --all-features +cd docs +mdbook build +``` It is available on: -https://uutils.github.io/coreutils-docs/coreutils/ +https://uutils.github.io/coreutils-docs/coreutils/user/ + +# Developer documentation: + +The code documentation is generated daily from the https://github.com/uutils/coreutils repository. + +It is available on: +https://uutils.github.io/coreutils-docs/coreutils/dev/ The pages are committed daily into the gh-pages branch.