-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Update docs-deploy workflow (#4993)
- Loading branch information
Showing
1 changed file
with
31 additions
and
18 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 |
---|---|---|
@@ -1,44 +1,57 @@ | ||
name: Docs | ||
name: Deploy documentation | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- docs | ||
|
||
jobs: | ||
test: | ||
name: Docs | ||
main: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Rust | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: nightly-2022-09-26 | ||
components: rust-docs | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.10' | ||
cache: 'pip' | ||
cache-dependency-path: 'py-polars/docs/requirements-docs.txt' | ||
- name: Install dependencies | ||
|
||
- name: Install Python dependencies | ||
working-directory: py-polars/docs | ||
run: | | ||
pip install --upgrade pip | ||
pip install -r requirements-docs.txt | ||
- name: Build python reference | ||
- name: Build Python documentation | ||
working-directory: py-polars/docs | ||
run: make html | ||
- name: deploy docs | ||
|
||
- name: Set up Rust | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: nightly-2022-09-26 | ||
components: rust-docs | ||
|
||
- name: Cache Rust | ||
uses: Swatinem/rust-cache@v2 | ||
|
||
- name: Build Rust documentation | ||
env: | ||
RUSTFLAGS: --cfg docsrs | ||
run: cargo doc --features=docs-selection --package polars | ||
|
||
- name: Prepare deployment | ||
run: | | ||
set -e | ||
cargo doc --features=docs-selection --package polars && \ | ||
echo '<meta http-equiv=refresh content=0;url=polars/index.html>' > target/doc/index.html && \ | ||
echo '<meta http-equiv=refresh content=0;url=polars/index.html>' > target/doc/index.html | ||
mkdir target/doc/py-polars | ||
cp -r py-polars/docs/build/html target/doc/py-polars | ||
echo ghp-import step | ||
ghp-import -n target/doc && \ | ||
mv py-polars/docs/build/html target/doc/py-polars | ||
- name: Deploy | ||
run: | | ||
ghp-import -n target/doc | ||
git push -qf https://${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git gh-pages | ||
# Make sure documentation artifacts are not cached | ||
- name: Clean up documentation artifacts | ||
run: rm -rf target/doc |