Skip to content

Commit

Permalink
Update deploy-docs.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
rfraposa committed Apr 12, 2022
1 parent 06769e8 commit 05c281b
Showing 1 changed file with 58 additions and 11 deletions.
69 changes: 58 additions & 11 deletions .github/workflows/deploy-docs.yml
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

0 comments on commit 05c281b

Please sign in to comment.