Build experimental docs #43
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
name: Build experimental docs | |
on: | |
push: | |
branches: | |
- jcannon/documentation | |
workflow_dispatch: | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
concurrency: | |
group: ${{ github.workflow }} | |
cancel-in-progress: true | |
jobs: | |
build_docs: | |
name: Build Experimental Docs | |
runs-on: ubuntu-latest | |
env: | |
PANTS_VERSION: 2.18.0.dev6 | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
with: | |
repository: thejcannon/pants | |
ref: jcannon/documentation | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' | |
- name: Cache Rust toolchain | |
uses: actions/cache@v3 | |
with: | |
key: Linux-x86_64-rustup-${{ hashFiles('rust-toolchain') }}-v2 | |
path: '~/.rustup/toolchains/1.71.0-* | |
~/.rustup/update-hashes | |
~/.rustup/settings.toml | |
' | |
- name: Cache Cargo | |
uses: benjyw/rust-cache@461b9f8eee66b575bce78977bf649b8b7a8d53f1 | |
with: | |
cache-bin: 'false' | |
shared-key: engine | |
workspaces: src/rust/engine | |
- id: get-engine-hash | |
name: Get native engine hash | |
run: echo "hash=$(./build-support/bin/rust/print_engine_hash.sh)" >> $GITHUB_OUTPUT | |
shell: bash | |
- name: Cache native engine | |
uses: actions/cache@v3 | |
with: | |
key: Linux-x86_64-engine-${{ steps.get-engine-hash.outputs.hash }}-v1 | |
path: 'src/python/pants/bin/native_client | |
src/python/pants/engine/internals/native_engine.so | |
src/python/pants/engine/internals/native_engine.so.metadata' | |
- name: Bootstrap Pants | |
run: ./pants version > ${{ runner.temp }}/_pants_version.stdout && [[ -s ${{ runner.temp }}/_pants_version.stdout ]] | |
- name: Convert docs | |
run: | | |
yq eval '.site_url = "https://thejcannon.github.io/pants/docs"' -i docs/mkdocs.yml | |
python docs/convert.py | |
- name: Build docs | |
run: | | |
# Not using Pants because I wanna go Sanic fast | |
pip install mkdocs mkdocs-material mkdocs-redirects mkdocs-gen-files git+https://github.com/thejcannon/mkdocs-awesome-pages-plugin@1e3502a24f8a6d265fe750a5a711a8d99a9ba811 | |
mkdocs build -f docs/mkdocs.yml | |
mkdir -p dist/site | |
mv docs/site dist/site/docs | |
- name: Setup Pages | |
uses: actions/configure-pages@v3 | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v2 | |
with: | |
path: dist/site | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v2 |