This is an automated email from the ASF dual-hosted git repository. tison pushed a commit to branch deploy in repository https://gitbox.apache.org/repos/asf/incubator-horaedb-docs.git
commit 17d2e82ae31e12634ecca7da91e79254dca1d0b0 Author: tison <[email protected]> AuthorDate: Mon Dec 25 18:51:28 2023 +0800 ci: deploy website Signed-off-by: tison <[email protected]> --- .asf.yaml | 11 +++++--- .github/workflows/deploy-docs.yml | 57 --------------------------------------- .github/workflows/deploy.yml | 29 ++++++++++++++++++++ Makefile | 6 ++--- docs/book.toml | 5 +--- docs/move.sh | 21 ++++++++++----- 6 files changed, 55 insertions(+), 74 deletions(-) diff --git a/.asf.yaml b/.asf.yaml index 718e8d6..9f5ac6e 100644 --- a/.asf.yaml +++ b/.asf.yaml @@ -18,9 +18,8 @@ # For more information, see https://cwiki.apache.org/confluence/display/INFRA/Git+-+.asf.yaml+features. github: - description: >- - HoraeDB Website. - homepage: https://apache.github.io/incubator-horaedb-docs # TODO: after website is ready, set to https://horaedb.apache.org/ + description: HoraeDB Website. + homepage: https://horaedb.apache.org/ labels: - rust - sql @@ -41,10 +40,14 @@ github: required_pull_request_reviews: dismiss_stale_reviews: true required_approving_review_count: 1 + asf-site: {} + +publish: + whoami: asf-site notifications: commits: [email protected] issues: [email protected] pullrequests: [email protected] jobs: [email protected] - discussions: [email protected] \ No newline at end of file + discussions: [email protected] diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml deleted file mode 100644 index 1d0e776..0000000 --- a/.github/workflows/deploy-docs.yml +++ /dev/null @@ -1,57 +0,0 @@ -name: Deploy Documentation - -on: - workflow_dispatch: - push: - branches: - - main - paths: - - "docs/**" - - ".github/workflows/deploy-docs.yml" - -# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages -permissions: - contents: read - pages: write - id-token: write - -# Allow one concurrent deployment -concurrency: - group: "pages" - cancel-in-progress: true - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - name: Cache Rust Dependencies - uses: actions/cache@v3 - with: - path: | - ~/.cargo - key: docs-${{ runner.os }} - - name: Install mdbook - run: | - make install - - name: Build - run: | - make build - - name: Upload artifact - uses: actions/upload-pages-artifact@v1 - with: - path: ./docs/book/html - - # Deployment job - deploy: - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - runs-on: ubuntu-latest - needs: build - steps: - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v1 diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..d2de092 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,29 @@ +name: Deploy Documentation + +on: + workflow_dispatch: + push: + branches: + - main + +# Allow one concurrent deployment +concurrency: + group: "pages" + cancel-in-progress: true + +jobs: + build: + deploy: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: Swatinem/rust-cache@v2 + - run: make install + - run: make build + - uses: peaceiris/actions-gh-pages@v3 + if: github.event_name != 'pull_request' + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./docs/book/html + publish_branch: asf-site diff --git a/Makefile b/Makefile index 987bd46..7fb9cff 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,12 @@ install: - cargo install [email protected] - cargo install mdbook-i18n --git https://github.com/chunshao90/mdbook-i18n.git --rev ca497cff369e0a5cedcd4024af6e1f05cc5050c5 + cargo install [email protected] + cargo install mdbook-i18n serve: cd docs && mdbook serve build: - cd docs && mdbook build + cd docs && mdbook build && ./move.sh lint: find . -name '*.md' | xargs npx [email protected] --write diff --git a/docs/book.toml b/docs/book.toml index dc9400f..49d8185 100644 --- a/docs/book.toml +++ b/docs/book.toml @@ -16,12 +16,9 @@ language = "cn" translators = ["HoraeDB Authors"] title = "HoraeDB 文档" -[output.random] -command = "/bin/bash ../../move.sh" - [output.html] git-repository-url = "https://github.com/apache/incubator-horaedb" -edit-url-template = "https://github.com/CeresDB/docs/edit/main/docs/{path}" +edit-url-template = "https://github.com/apache/incubator-horaedb-docs/edit/main/docs/{path}" additional-css = ["style.css"] additional-js = ["sidebar.js"] diff --git a/docs/move.sh b/docs/move.sh old mode 100644 new mode 100755 index 4c529f4..8b3fd72 --- a/docs/move.sh +++ b/docs/move.sh @@ -1,6 +1,15 @@ -#!/bin/bash -echo "ready to move files" -cp -r ../i18n/cn ../html/cn -cp -r ../i18n/en ../html/en -cp -r ../../src/resources ../../book/html/resources -echo "copy done" +#!/usr/bin/env bash + +set -exo + +cd $( dirname ${0} ) >/dev/null 2>&1 + +echo "Moving files ..." + +cp -R book/i18n/cn book/html/cn +cp -R book/i18n/en book/html/en +cp -R resources book/html/resources + +cp ../.asf.yaml book/html/.asf.yaml + +echo "Files has been moved." --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
