Skip to content

Commit

Permalink
feat: support sync docs from multiple PRs (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
Oreoxmt authored Dec 4, 2023
1 parent 8a195d0 commit 4a231f3
Show file tree
Hide file tree
Showing 74 changed files with 23,025 additions and 3 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/sync_mult_prs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Sync doc changes from multiple PRs

on:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:

sync_mult_prs:
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- name: Checkout current repo
uses: actions/checkout@v3

- name: Run sync_mult_prs script
run: |
git config user.name "Docsite Preview Bot"
git config user.email ""
./sync_mult_prs.sh
./.github/git_push.sh ${{ github.ref_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/sync_pr.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Sync documentation changes from a PR to the preview branch
name: Sync doc changes from a PR

on:
push:
Expand Down
36 changes: 36 additions & 0 deletions sync_mult_prs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash

# Synchronize the content of multiple PRs to the markdown-pages folder to deploy a preview website.

# Usage: ./sync_mult_prs.sh

set -ex

# Get the directory of this script.
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
cd "$SCRIPT_DIR"


# Define the PRs to sync.
# The PRs will be synced in the order of the following statements.
./sync_pr.sh preview/pingcap/docs/"$DOCS_PR"
./sync_pr.sh preview/pingcap/docs-cn/"$DOCS_CN_PR"
./sync_pr.sh preview-cloud/pingcap/docs/"$CLOUD_DOCS_PR"
./sync_pr.sh preview-operator/pingcap/docs-tidb-operator/"$OPERATOR_DOCS_PR"

# Synchronize the content from master to release-x.y directories.
rsync -av markdown-pages/zh/tidb/master/ markdown-pages/zh/tidb/"$RELEASE_DIR"/
rsync -av markdown-pages/en/tidb/master/ markdown-pages/en/tidb/"$RELEASE_DIR"/
rsync -av markdown-pages/en/tidb-in-kubernetes/master/ markdown-pages/en/tidb-in-kubernetes/"$RELEASE_DIR"/
rsync -av markdown-pages/zh/tidb-in-kubernetes/master/ markdown-pages/zh/tidb-in-kubernetes/"$RELEASE_DIR"/

commit_changes() {
# Exit if TEST is set and not empty.
test -n "$TEST" && echo "Test mode, exiting..." && exit 0
# Handle untracked files.
git add .
# Commit changes, if any.
git commit -m "Update the {release-x.y} directory" || echo "No changes to commit"
}

commit_changes
Original file line number Diff line number Diff line change
@@ -0,0 +1,214 @@
<!-- markdownlint-disable MD007 -->
<!-- markdownlint-disable MD041 -->

- [TiDB on Kubernetes Docs](https://docs.pingcap.com/tidb-in-kubernetes/dev)
- Introduction
- [Overview](tidb-operator-overview.md)
- [What's New in v1.5](whats-new-in-v1.5.md)
- [Get Started](get-started.md)
- Deploy
- On Self-Managed Kubernetes
- [Prerequisites](prerequisites.md)
- [Configure Storage Class](configure-storage-class.md)
- [Deploy TiDB Operator](deploy-tidb-operator.md)
- [Configure a TiDB Cluster](configure-a-tidb-cluster.md)
- [Deploy a TiDB Cluster](deploy-on-general-kubernetes.md)
- [Initialize a TiDB Cluster](initialize-a-cluster.md)
- [Access a TiDB Cluster](access-tidb.md)
- On Public Cloud Kubernetes
- [Amazon EKS](deploy-on-aws-eks.md)
- [Google Cloud GKE](deploy-on-gcp-gke.md)
- [Azure AKS](deploy-on-azure-aks.md)
- [Alibaba Cloud ACK](deploy-on-alibaba-cloud.md)
- [Deploy TiDB on ARM64 Machines](deploy-cluster-on-arm64.md)
- [Deploy TiFlash to Explore TiDB HTAP](deploy-tiflash.md)
- Deploy TiDB Across Multiple Kubernetes Clusters
- [Build Multiple Interconnected AWS EKS Clusters](build-multi-aws-eks.md)
- [Build Multiple Interconnected GKE Clusters](build-multi-gcp-gke.md)
- [Deploy TiDB Across Multiple Kubernetes Clusters](deploy-tidb-cluster-across-multiple-kubernetes.md)
- [Deploy a Heterogeneous TiDB Cluster](deploy-heterogeneous-tidb-cluster.md)
- [Deploy TiCDC](deploy-ticdc.md)
- [Deploy TiDB Binlog](deploy-tidb-binlog.md)
- Monitor and Alert
- [Deploy Monitoring and Alerts for TiDB](monitor-a-tidb-cluster.md)
- [Monitor and Diagnose TiDB Using TiDB Dashboard](access-dashboard.md)
- [Aggregate Monitoring Data of Multiple TiDB Clusters](aggregate-multiple-cluster-monitor-data.md)
- [Monitor a TiDB Cluster across Multiple Kubernetes Clusters](deploy-tidb-monitor-across-multiple-kubernetes.md)
- [Enable Dynamic Configuration for TidbMonitor](enable-monitor-dynamic-configuration.md)
- [Enable Shards for TidbMonitor](enable-monitor-shards.md)
- Migrate
- [Import Data](restore-data-using-tidb-lightning.md)
- Migrate from MySQL
- [Deploy DM](deploy-tidb-dm.md)
- [Migrate to TiDB Using DM](use-tidb-dm.md)
- [Migrate TiDB to Kubernetes](migrate-tidb-to-kubernetes.md)
- Manage
- Secure
- [Enable TLS for the MySQL Client](enable-tls-for-mysql-client.md)
- [Enable TLS between TiDB Components](enable-tls-between-components.md)
- [Enable TLS for DM](enable-tls-for-dm.md)
- [Replicate Data to TLS-enabled Downstream Services](enable-tls-for-ticdc-sink.md)
- [Renew and Replace the TLS Certificate](renew-tls-certificate.md)
- [Run Containers as a Non-root User](containers-run-as-non-root-user.md)
- [Scale](scale-a-tidb-cluster.md)
- Upgrade
- [Upgrade a TiDB Cluster](upgrade-a-tidb-cluster.md)
- Upgrade TiDB Operator
- [Normal Upgrade](upgrade-tidb-operator.md)
- [Canary Upgrade](canary-upgrade-tidb-operator.md)
- Backup and Restore
- [Overview](backup-restore-overview.md)
- [Backup and Restore Custom Resources](backup-restore-cr.md)
- [Grant Permissions to Remote Storage](grant-permissions-to-remote-storage.md)
- Amazon S3 Compatible Storage
- [Back Up Data Using BR](backup-to-aws-s3-using-br.md)
- [Restore Data Using BR](restore-from-aws-s3-using-br.md)
- [Back Up Data Using Dumpling](backup-to-s3.md)
- [Restore Data Using TiDB Lightning](restore-from-s3.md)
- Google Cloud Storage
- [Back Up Data Using BR](backup-to-gcs-using-br.md)
- [Restore Data Using BR](restore-from-gcs-using-br.md)
- [Back Up Data Using Dumpling](backup-to-gcs.md)
- [Restore Data Using TiDB Lightning](restore-from-gcs.md)
- Azure Blob Storage
- [Back Up Data Using BR](backup-to-azblob-using-br.md)
- [Restore Data Using BR](restore-from-azblob-using-br.md)
- Persistent Volumes
- [Back Up Data](backup-to-pv-using-br.md)
- [Restore Data](restore-from-pv-using-br.md)
- Snapshot Backup and Restore
- [Architecture](volume-snapshot-backup-restore.md)
- [Back Up Data Using EBS Snapshots](backup-to-aws-s3-by-snapshot.md)
- [Restore Data from EBS Snapshots](restore-from-aws-s3-by-snapshot.md)
- [Backup and Restore Performance](backup-restore-snapshot-perf.md)
- [FAQs](backup-restore-faq.md)
- Maintain
- [Restart a TiDB Cluster](restart-a-tidb-cluster.md)
- [Destroy a TiDB Cluster](destroy-a-tidb-cluster.md)
- [View TiDB Logs](view-logs.md)
- [Modify TiDB Cluster Configuration](modify-tidb-configuration.md)
- [Configure Automatic Failover](use-auto-failover.md)
- [Pause Sync of a TiDB Cluster](pause-sync-of-tidb-cluster.md)
- [Suspend a TiDB Cluster](suspend-tidb-cluster.md)
- [Maintain Different TiDB Clusters Separately Using Multiple TiDB Operator](deploy-multiple-tidb-operator.md)
- [Maintain Kubernetes Nodes](maintain-a-kubernetes-node.md)
- [Migrate from Helm 2 to Helm 3](migrate-to-helm3.md)
- Replace Nodes for a TiDB Cluster
- [Replace Nodes on Cloud Disks](replace-nodes-for-cloud-disk.md)
- [Replace Nodes on Local Disks](replace-nodes-for-local-disk.md)
- Disaster Recovery
- [Recover a Deleted TiDB Cluster](recover-deleted-cluster.md)
- [Recover a PD Cluster](pd-recover.md)
- Troubleshoot
- [Troubleshooting Tips](tips.md)
- [Deployment Failures](deploy-failures.md)
- [Cluster Exceptions](exceptions.md)
- [Network Issues](network-issues.md)
- [Troubleshoot TiDB Cluster Using PingCAP Clinic](clinic-user-guide.md)
- [FAQs](faq.md)
- Reference
- Architecture
- [TiDB Operator](architecture.md)
- [TiDB Scheduler](tidb-scheduler.md)
- [Advanced StatefulSet Controller](advanced-statefulset.md)
- [Admission Controller](enable-admission-webhook.md)
- [Sysbench Performance Test](benchmark-sysbench.md)
- [API References](https://github.com/pingcap/tidb-operator/blob/master/docs/api-references/docs.md)
- [Cheat Sheet](cheat-sheet.md)
- [Required RBAC Rules](tidb-operator-rbac.md)
- Tools
- [tkctl](use-tkctl.md)
- [TiDB Toolkit](tidb-toolkit.md)
- Configure
- [Configure tidb-drainer Chart](configure-tidb-binlog-drainer.md)
- [Log Collection](logs-collection.md)
- [Monitoring and Alert on Kubernetes](monitor-kubernetes.md)
- [PingCAP Clinic Diagnostic Data](clinic-data-collection.md)
- Release Notes
- v1.5
- [1.5 GA](releases/release-1.5.0.md)
- [1.5.0-beta.1](releases/release-1.5.0-beta.1.md)
- v1.4
- [1.4.5](releases/release-1.4.5.md)
- [1.4.4](releases/release-1.4.4.md)
- [1.4.3](releases/release-1.4.3.md)
- [1.4.2](releases/release-1.4.2.md)
- [1.4.1](releases/release-1.4.1.md)
- [1.4 GA](releases/release-1.4.0.md)
- [1.4.0-beta.3](releases/release-1.4.0-beta.3.md)
- [1.4.0-beta.2](releases/release-1.4.0-beta.2.md)
- [1.4.0-beta.1](releases/release-1.4.0-beta.1.md)
- [1.4.0-alpha.1](releases/release-1.4.0-alpha.1.md)
- v1.3
- [1.3.10](releases/release-1.3.10.md)
- [1.3.9](releases/release-1.3.9.md)
- [1.3.8](releases/release-1.3.8.md)
- [1.3.7](releases/release-1.3.7.md)
- [1.3.6](releases/release-1.3.6.md)
- [1.3.5](releases/release-1.3.5.md)
- [1.3.4](releases/release-1.3.4.md)
- [1.3.3](releases/release-1.3.3.md)
- [1.3.2](releases/release-1.3.2.md)
- [1.3.1](releases/release-1.3.1.md)
- [1.3 GA](releases/release-1.3.0.md)
- [1.3.0-beta.1](releases/release-1.3.0-beta.1.md)
- v1.2
- [1.2.7](releases/release-1.2.7.md)
- [1.2.6](releases/release-1.2.6.md)
- [1.2.5](releases/release-1.2.5.md)
- [1.2.4](releases/release-1.2.4.md)
- [1.2.3](releases/release-1.2.3.md)
- [1.2.2](releases/release-1.2.2.md)
- [1.2.1](releases/release-1.2.1.md)
- [1.2 GA](releases/release-1.2.0.md)
- [1.2.0-rc.2](releases/release-1.2.0-rc.2.md)
- [1.2.0-rc.1](releases/release-1.2.0-rc.1.md)
- [1.2.0-beta.2](releases/release-1.2.0-beta.2.md)
- [1.2.0-beta.1](releases/release-1.2.0-beta.1.md)
- [1.2.0-alpha.1](releases/release-1.2.0-alpha.1.md)
- v1.1
- [1.1.15](releases/release-1.1.15.md)
- [1.1.14](releases/release-1.1.14.md)
- [1.1.13](releases/release-1.1.13.md)
- [1.1.12](releases/release-1.1.12.md)
- [1.1.11](releases/release-1.1.11.md)
- [1.1.10](releases/release-1.1.10.md)
- [1.1.9](releases/release-1.1.9.md)
- [1.1.8](releases/release-1.1.8.md)
- [1.1.7](releases/release-1.1.7.md)
- [1.1.6](releases/release-1.1.6.md)
- [1.1.5](releases/release-1.1.5.md)
- [1.1.4](releases/release-1.1.4.md)
- [1.1.3](releases/release-1.1.3.md)
- [1.1.2](releases/release-1.1.2.md)
- [1.1.1](releases/release-1.1.1.md)
- [1.1 GA](releases/release-1.1-ga.md)
- [1.1.0-rc.4](releases/release-1.1.0-rc.4.md)
- [1.1.0-rc.3](releases/release-1.1.0-rc.3.md)
- [1.1.0-rc.2](releases/release-1.1.0-rc.2.md)
- [1.1.0-rc.1](releases/release-1.1.0-rc.1.md)
- [1.1.0-beta.2](releases/release-1.1.0-beta.2.md)
- [1.1.0-beta.1](releases/release-1.1.0-beta.1.md)
- v1.0
- [1.0.7](releases/release-1.0.7.md)
- [1.0.6](releases/release-1.0.6.md)
- [1.0.5](releases/release-1.0.5.md)
- [1.0.4](releases/release-1.0.4.md)
- [1.0.3](releases/release-1.0.3.md)
- [1.0.2](releases/release-1.0.2.md)
- [1.0.1](releases/release-1.0.1.md)
- [1.0 GA](releases/release-1.0-ga.md)
- [1.0.0-rc.1](releases/release-1.0.0-rc.1.md)
- [1.0.0-beta.3](releases/release-1.0.0-beta.3.md)
- [1.0.0-beta.2](releases/release-1.0.0-beta.2.md)
- [1.0.0-beta.1-p2](releases/release-1.0.0-beta.1-p2.md)
- [1.0.0-beta.1-p1](releases/release-1.0.0-beta.1-p1.md)
- [1.0.0-beta.1](releases/release-1.0.0-beta.1.md)
- [1.0.0-beta.0](releases/release-1.0.0-beta.0.md)
- v0
- [0.4.0](releases/release-0.4.0.md)
- [0.3.1](releases/release-0.3.1.md)
- [0.3.0](releases/release-0.3.0.md)
- [0.2.1](releases/release-0.2.1.md)
- [0.2.0](releases/release-0.2.0.md)
- [0.1.0](releases/release-0.1.0.md)
Loading

0 comments on commit 4a231f3

Please sign in to comment.