-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a workflow that builds the docs and deploys them at staged or pro…
…duction Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
- Loading branch information
Showing
1 changed file
with
67 additions
and
0 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 |
---|---|---|
@@ -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 }} |