Skip to content

Build and Deploy

Build and Deploy #2050

Workflow file for this run

name: Build and Deploy
on:
pull_request:
branches:
- master
push:
branches:
- master
schedule:
- cron: '0 5 * * *'
env:
# We use the repo in swap/dolphinscheduler to build all python versions docs
PYDS_HOME: swap/dolphinscheduler-sdk-python
DEPENDENCES: pip setuptools wheel tox
jobs:
build-website-deploy:
runs-on: ubuntu-latest
steps:
# Build main document: DolphinScheduler documentation
- name: Checkout
uses: actions/checkout@master
- name: Prepare Related Resource
run: ./scripts/prepare_docs.sh
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: 18.12.1
- name: Build Main Document
run: yarn && yarn build
# Build Python API document: from https://github.com/apache/dolphinscheduler-sdk-python
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Build Python Multiple Version Document
working-directory: ${{ env.PYDS_HOME }}
# rsync all files in directory docs/build/html/versions expect .doctrees have sensitive data, so we need to delete it
run: |
python -m pip install --upgrade ${{ env.DEPENDENCES }}
python -m tox -vv -e doc-build-multi
rsync -av --progress --exclude .doctrees docs/build/html/versions/* ${GITHUB_WORKSPACE}/build/python
- name: Deploy
if: ${{ github.event_name == 'push' || github.event_name == 'schedule' }}
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: asf-site
publish_dir: ./build
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
commit_message: 'Automated deployment:'