forked from ClickHouse/clickhouse-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
58 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,63 @@ | ||
name: Alert parent repository on push | ||
on: push | ||
name: deploy-docs-website | ||
|
||
on: | ||
# Run the action on every push | ||
push: | ||
branches: [staging] | ||
# Run the action every 3 hours | ||
# because this repo is unaware of changes to the ClickHouse/ClickHouse/docs folder | ||
# schedule: | ||
# - cron: '0 */3 * * *' | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
build: | ||
name: Dispatch to `other-repo` | ||
publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Emit repository_dispatch | ||
uses: mvasigh/dispatch-action@main | ||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
- name: Check out repo | ||
uses: actions/checkout@v2 | ||
# Node is required for npm | ||
- name: Set up Node | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '16.9.1' | ||
# Download the reference docs from ClickHouse/ClickHouse | ||
- name: Download Reference Doc | ||
run: | | ||
mkdir tmp | ||
curl https://codeload.github.com/ClickHouse/ClickHouse/tar.gz/docs-staging | tar -xz -C tmp/ --strip=2 "ClickHouse-docs-staging/docs/" | ||
cp -R tmp/en docs | ||
cp -R tmp/ru docs/ | ||
cp -R tmp/zh docs/ | ||
# Install and build Docusaurus website | ||
- name: Build Docusaurus website | ||
run: | | ||
npm update | ||
npm install | ||
npm run build | ||
- name: Deploy to GitHub Pages | ||
if: success() | ||
uses: crazy-max/ghaction-github-pages@v2 | ||
with: | ||
target_branch: gh-pages | ||
build_dir: build | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Deploy to GitHub Pages | ||
if: success() | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
# You should create a personal access token and store it in your repository | ||
token: ${{ secrets.DEPLOY_DOCS_TOKEN }} | ||
repo: ClickHouse/clickhouse-docs-content | ||
owner: rfraposa | ||
event_type: sample_push | ||
deploy_key: ${{ secrets.DEPLOY_DOCS_TOKEN }} | ||
external_repository: ClickHouse/clickhouse-docs-content | ||
publish_branch: main | ||
publish_dir: ./docs | ||
# uses: JamesIves/[email protected] | ||
# with: | ||
# repository-name: ClickHouse/clickhouse-docs-content | ||
# token: ${{ secrets.ROBOT_CLICKHOUSE_COMMIT_TOKEN }} | ||
# branch: gh-pages | ||
# folder: build |