Skip to content

Commit 91cf623

Browse files
committed
Merge branch 'main' of https://github.com/ClickHouse/clickhouse-docs into byoc-onboarding
2 parents b031aae + 7b97e03 commit 91cf623

File tree

193 files changed

+5360
-1187
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

193 files changed

+5360
-1187
lines changed

.github/workflows/build-search.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Update Algolia Search
2+
3+
on:
4+
pull_request:
5+
types:
6+
- closed
7+
8+
workflow_dispatch:
9+
10+
schedule:
11+
- cron: '0 4 * * *'
12+
13+
env:
14+
PYTHONUNBUFFERED: 1 # Force the stdout and stderr streams to be unbuffered
15+
16+
jobs:
17+
update-search:
18+
if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'update search') && github.event.pull_request.base.ref == 'main'
19+
#if: contains(github.event.pull_request.labels.*.name, 'update search') # Updated to trigger directly on PRs with the label
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
- name: Checkout Repository
24+
uses: actions/checkout@v3
25+
26+
- name: Set up Node.js
27+
uses: actions/setup-node@v3
28+
with:
29+
node-version: '20'
30+
31+
- name: Run Prep from Master
32+
run: yarn copy-clickhouse-repo-docs
33+
34+
- name: Run Auto Generate Settings
35+
run: yarn auto-generate-settings
36+
37+
- name: Run Indexer
38+
run: yarn run-indexer
39+
env:
40+
ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }}
41+
ALGOLIA_APP_ID: 5H9UG7CX5W
42+
43+
- name: Verify Completion
44+
run: echo "All steps completed successfully!"
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# This GitHub Action is used for triggering updates of
2+
# the toc.json files present in any directory that
3+
# needs an automatically generated table of contents.
4+
5+
name: Generate Table of Contents files
6+
7+
env:
8+
# Force the stdout and stderr streams to be unbuffered
9+
PYTHONUNBUFFERED: 1
10+
11+
on:
12+
schedule:
13+
- cron: '0 0 * * *'
14+
workflow_dispatch:
15+
16+
permissions:
17+
contents: write
18+
19+
jobs:
20+
generate_toc_formats:
21+
runs-on: ubuntu-latest
22+
steps:
23+
24+
# Step 1 - Check out the repository
25+
- name: Check out repository
26+
uses: actions/checkout@v3
27+
28+
# Step 2 - Pull changes
29+
- name: Pull remote Changes
30+
run: git pull
31+
32+
# Step 3 - Setup python
33+
- name: Set up python
34+
uses: actions/setup-python@v3
35+
with:
36+
python-version: '3.x'
37+
38+
# Step 4 - Install python dependencies
39+
- name: Install dependencies
40+
run: |
41+
python -m pip install --upgrade pip
42+
pip install -r 'scripts/table-of-contents-generator/requirements.txt'
43+
44+
# Step 5 - Pull main repo docs, run script to generate TOCs:
45+
- name: Generate table of contents files
46+
run: |
47+
yarn prep-from-master
48+
python -u ./scripts/table-of-contents-generator/toc_gen.py --dir="docs/en/interfaces/formats" --single-toc --out="table-of-contents-files" --ignore "_snippets"
49+
50+
# Step 6 - Fail the workflow if script returns exit code 1
51+
- name: Check exit code
52+
run: |
53+
if [[ "${{ steps.toc_gen.outcome }}" == "failure" ]]; then
54+
echo "Ran into trouble generating a table of contents. See the logs for details."
55+
exit 1
56+
fi
57+
58+
# Step 7 - Check if anything was actually updated
59+
- name: Check for changes
60+
id: check_changes
61+
run: |
62+
git status -u
63+
if [[ -n "$(git diff --exit-code)" ]]; then
64+
echo "Changes detected."
65+
echo "has_changes=true" >> $GITHUB_OUTPUT
66+
else
67+
echo "No changes detected."
68+
echo "has_changes=false" >> $GITHUB_OUTPUT
69+
fi
70+
71+
# Step 8 - Commit and Push generated Table Of Contents files
72+
- uses: stefanzweifel/git-auto-commit-action@v5
73+
env:
74+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
75+
with:
76+
commit_message: "Autogenerate table of contents files from GitHub action - $(date '+%Y-%m-%d %H:%M:%S')"
77+
file_pattern: 'table-of-contents-files/*'
78+
branch: generate_table_of_contents
79+
create_branch: true

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,6 @@ docs/en/cloud/manage/api/services-api-reference.md
4949
.vscode
5050
.aspell.en.prepl
5151
*.md.bak
52+
53+
# Don't ignore generated table of contents files
54+
!toc.json

copyClickhouseRepoDocs.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,13 @@ echo "[$SCRIPT_NAME] Copying completed"
3131

3232
echo "[$SCRIPT_NAME] Generate changelog"
3333
cp docs/en/_placeholders/changelog/_index.md docs/en/whats-new/changelog/index.md
34-
if grep -q '^# $(date +%Y) Changelog' ClickHouse/CHANGELOG.md; then
35-
sed '/^# $(date +%Y) Changelog/d' ClickHouse/CHANGELOG.md > temp.txt
36-
cat >> docs/en/whats-new/changelog/index.md
37-
rm temp.txt
34+
if grep -q "^# $(date +%Y) Changelog" ClickHouse/CHANGELOG.md; then
35+
echo "Generating $(date +%Y) Changelog..."
36+
sed "/^# $(date +%Y) Changelog/d" ClickHouse/CHANGELOG.md > temp.txt
37+
echo "Changelog copied to temp.txt"
38+
cat temp.txt >> docs/en/whats-new/changelog/index.md
39+
echo "Changelog written to docs/en/whats-new/changelog/index.md"
40+
rm -f temp.txt
3841
echo "$(date +%Y) Changelog was updated."
3942
else
4043
current_year="$(date +%Y)"

docs/en/_snippets/_add_remote_ip_access_list_detail.md

Lines changed: 2 additions & 2 deletions

docs/en/_snippets/_check_ip_access_list_detail.md

Lines changed: 0 additions & 17 deletions
This file was deleted.

docs/en/_snippets/_clickhouse_mysql_cloud_setup.mdx

Lines changed: 30 additions & 5 deletions

docs/en/_snippets/_cloud_backup.md

Lines changed: 0 additions & 19 deletions
This file was deleted.

docs/en/_snippets/_launch_sql_console.md

Lines changed: 5 additions & 1 deletion
Lines changed: 1 addition & 1 deletion

0 commit comments

Comments
 (0)