-
Notifications
You must be signed in to change notification settings - Fork 1
98 lines (93 loc) · 3.28 KB
/
publish.yml
File metadata and controls
98 lines (93 loc) · 3.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: Publish Doc
on:
push:
branches: [main]
schedule:
- cron: '0 */2 * * *' # every 2 hours
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: write
env:
# This env var is used by Swatinem/rust-cache@v2 for the cache
# key, so we set it to make sure it is always consistent.
CARGO_TERM_COLOR: always
# Disable full debug symbol generation to speed up CI build and keep memory down
# "1" means line tables only, which is useful for panic tracebacks.
RUSTFLAGS: "-C debuginfo=1"
RUST_BACKTRACE: "1"
# according to: https://matklad.github.io/2021/09/04/fast-rust-builds.html
# CI builds are faster with incremental disabled.
CARGO_INCREMENTAL: "0"
CARGO_BUILD_JOBS: "1"
jobs:
build-and-deploy:
# scheduled run should only happen on main repo not forked ones.
if: |
github.event_name != 'schedule' || github.repository == 'lance-format/lance-python-doc'
runs-on: ubuntu-24.04
timeout-minutes: 60
strategy:
matrix:
python-version: [ 3.11 ] # Ray does not support 3.12 yet.
steps:
- name: Install dependencies
run: |
sudo apt update
sudo apt install -y protobuf-compiler libssl-dev
# pin the toolchain version to avoid surprises
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
- uses: rui314/setup-mold@v1
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Checkout lance-python-doc repo
uses: actions/checkout@v4
- name: Checkout lance repo
uses: actions/checkout@v4
with:
repository: lance-format/lance
path: lance
- uses: Swatinem/rust-cache@v2
with:
workspaces: lance/python
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Copy docs to Lance
run: |
mv docs lance/python/docs
- name: Set up Python virtual environment
run: |
python -m venv venv
source venv/bin/activate
pip install maturin
pip install -r lance/python/docs/requirements.txt
- name: Build Doc
working-directory: lance/python
run: |
source ../../venv/bin/activate
maturin develop
sphinx-build -b html docs docs/_build/html
- name: Add .nojekyll
run: |
touch lance/python/docs/_build/html/.nojekyll
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: lance/python/docs/_build/html