Skip to content

Commit

Permalink
Add a workflow that builds the docs and deploys them at staged or pro…
Browse files Browse the repository at this point in the history
…duction

Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
  • Loading branch information
martin-g committed Dec 5, 2022
1 parent 1180321 commit aea783e
Showing 1 changed file with 67 additions and 0 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
on:
push:
branches:
- master
tags:
- "!**-rc"
paths:
- docs/**
- .github/workflows/docs.yml


name: Deploy Datafusion Python site

jobs:
build-docs:
name: Build docs
runs-on: ubuntu-latest
steps:
- name: Set target branch
id: target-branch
run: |
if test '${{ github.ref }}' = 'refs/heads/master'; then
echo "value=asf-staging" >> $GITHUB_OUTPUT
elif test '${{ github.ref_type }}' = 'tag'; then
echo "value=asf-site" >> $GITHUB_OUTPUT
fi
- name: Checkout docs sources
uses: actions/checkout@v3
- name: Checkout docs target branch
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ steps.target-branch.outputs.value }}
path: docs-target
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.10"

- name: Install dependencies
run: |
python3 -m venv venv
source venv/bin/activate
pip install -r requirements-310.txt
pip install -r docs/requirements.txt
- name: Build Datafusion
run: |
source venv/bin/activate
maturin develop
- name: Build docs
run: |
source venv/bin/activate
cd docs
make html
- name: Copy & push the generated HTML
run: |
cd docs-target
find ./ -name "*.html" -type f -print0 | xargs -0 /bin/rm -f
cp -r ../docs/build/html/* .
git config --global user.name 'GitHub Actions'
git config --global user.email '[email protected]'
git add --all
git commit -m 'Publish built docs triggered by ${{ github.sha }}'
git push -f origin ${{ steps.target-branch.outputs.value }}

0 comments on commit aea783e

Please sign in to comment.