Skip to content

Commit

Permalink
ci: Update docs-deploy workflow (#4993)
Browse files Browse the repository at this point in the history
  • Loading branch information
stinodego committed Sep 30, 2022
1 parent 246b600 commit a031f09
Showing 1 changed file with 31 additions and 18 deletions.
49 changes: 31 additions & 18 deletions .github/workflows/docs-deploy.yaml
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

0 comments on commit a031f09

Please sign in to comment.