Build and Deploy #1995
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
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:' |