From e4c068cbd0ca289a2a43dbffad409d6c29c5de3a Mon Sep 17 00:00:00 2001 From: oluceps Date: Fri, 15 Nov 2024 00:12:32 +0800 Subject: [PATCH] + ci build docs --- .github/workflows/doc.yaml | 41 ++++++++++++++++++++++++++++++ {docs => doc}/.gitignore | 0 {docs => doc}/book.toml | 0 {docs => doc}/src/SUMMARY.md | 0 {docs => doc}/src/advanced.md | 0 {docs => doc}/src/faq.md | 0 {docs => doc}/src/flake-option.md | 0 {docs => doc}/src/minimal-setup.md | 0 {docs => doc}/src/nixos-option.md | 0 {docs => doc}/src/prerequisits.md | 0 {docs => doc}/src/setup.md | 0 11 files changed, 41 insertions(+) create mode 100644 .github/workflows/doc.yaml rename {docs => doc}/.gitignore (100%) rename {docs => doc}/book.toml (100%) rename {docs => doc}/src/SUMMARY.md (100%) rename {docs => doc}/src/advanced.md (100%) rename {docs => doc}/src/faq.md (100%) rename {docs => doc}/src/flake-option.md (100%) rename {docs => doc}/src/minimal-setup.md (100%) rename {docs => doc}/src/nixos-option.md (100%) rename {docs => doc}/src/prerequisits.md (100%) rename {docs => doc}/src/setup.md (100%) diff --git a/.github/workflows/doc.yaml b/.github/workflows/doc.yaml new file mode 100644 index 0000000..2191b06 --- /dev/null +++ b/.github/workflows/doc.yaml @@ -0,0 +1,41 @@ +name: Deploy docs + +on: + push: + branches: ["main"] + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Pages + uses: actions/configure-pages@v5 + - name: Install mdBook + run: | + cargo install mdbook --no-default-features --features search --vers "^0.4" --locked + - name: Build mdBook + run: | + cd doc + mdbook build + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: './doc/book' + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/docs/.gitignore b/doc/.gitignore similarity index 100% rename from docs/.gitignore rename to doc/.gitignore diff --git a/docs/book.toml b/doc/book.toml similarity index 100% rename from docs/book.toml rename to doc/book.toml diff --git a/docs/src/SUMMARY.md b/doc/src/SUMMARY.md similarity index 100% rename from docs/src/SUMMARY.md rename to doc/src/SUMMARY.md diff --git a/docs/src/advanced.md b/doc/src/advanced.md similarity index 100% rename from docs/src/advanced.md rename to doc/src/advanced.md diff --git a/docs/src/faq.md b/doc/src/faq.md similarity index 100% rename from docs/src/faq.md rename to doc/src/faq.md diff --git a/docs/src/flake-option.md b/doc/src/flake-option.md similarity index 100% rename from docs/src/flake-option.md rename to doc/src/flake-option.md diff --git a/docs/src/minimal-setup.md b/doc/src/minimal-setup.md similarity index 100% rename from docs/src/minimal-setup.md rename to doc/src/minimal-setup.md diff --git a/docs/src/nixos-option.md b/doc/src/nixos-option.md similarity index 100% rename from docs/src/nixos-option.md rename to doc/src/nixos-option.md diff --git a/docs/src/prerequisits.md b/doc/src/prerequisits.md similarity index 100% rename from docs/src/prerequisits.md rename to doc/src/prerequisits.md diff --git a/docs/src/setup.md b/doc/src/setup.md similarity index 100% rename from docs/src/setup.md rename to doc/src/setup.md