diff --git a/.github/workflows/presubmit.yml b/.github/workflows/presubmit.yml new file mode 100644 index 00000000..a2a4f147 --- /dev/null +++ b/.github/workflows/presubmit.yml @@ -0,0 +1,20 @@ +name: presubmit + +on: + pull_request: + branches: + - master + +jobs: + presubmit: + name: Presubmit Tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Setup mdBook + shell: bash + run: | + cargo version + cargo install mdbook-llms-txt-tools mdbook@0.4.52 + + - run: mdbook build diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 04616c54..726d6510 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -11,15 +11,20 @@ jobs: - uses: actions/checkout@v3 - name: Setup mdBook - uses: peaceiris/actions-mdbook@v1 - with: - mdbook-version: 'latest' + shell: bash + run: | + cargo version + cargo install mdbook-llms-txt-tools mdbook@0.4.52 - run: mdbook build + - name: Fix the llms.txt location + run: | + mv book/llms-txt/llms.txt book/html/llms.txt + mv book/llms-txt-full/llms-full.txt book/html/llms-full.txt - name: Deploy uses: peaceiris/actions-gh-pages@v3 if: github.ref == 'refs/heads/master' with: github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./book + publish_dir: ./book/html diff --git a/README.md b/README.md index 3a666136..3af55771 100644 --- a/README.md +++ b/README.md @@ -26,18 +26,18 @@ your web browser. _Firefox:_ ```bash -$ firefox book/index.html # Linux -$ open -a "Firefox" book/index.html # OS X -$ Start-Process "firefox.exe" .\book\index.html # Windows (PowerShell) -$ start firefox.exe .\book\index.html # Windows (Cmd) +$ firefox book/html/index.html # Linux +$ open -a "Firefox" book/html/index.html # OS X +$ Start-Process "firefox.exe" .\book\html\index.html # Windows (PowerShell) +$ start firefox.exe .\book\html\index.html # Windows (Cmd) ``` _Chrome:_ ```bash -$ google-chrome book/index.html # Linux -$ open -a "Google Chrome" book/index.html # OS X -$ Start-Process "chrome.exe" .\book\index.html # Windows (PowerShell) -$ start chrome.exe .\book\index.html # Windows (Cmd) +$ google-chrome book/html/index.html # Linux +$ open -a "Google Chrome" book/html/index.html # OS X +$ Start-Process "chrome.exe" .\book\html\index.html # Windows (PowerShell) +$ start chrome.exe .\book\html\index.html # Windows (Cmd) ``` ## Contribute to this guide diff --git a/book.toml b/book.toml index 42b8d499..95194209 100644 --- a/book.toml +++ b/book.toml @@ -3,3 +3,7 @@ title = "TiDB Development Guide" [output.html] git-repository-url = "https://github.com/pingcap/tidb-dev-guide" + +[output.llms-txt] + +[output.llms-txt-full] \ No newline at end of file