Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix docs workflow #468

Merged
merged 2 commits into from
Jun 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 39 additions & 31 deletions .github/workflows/docs-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,57 +10,65 @@ on:
workflow_dispatch:

jobs:
build:
test-examples:
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- run: |
mkdir /tmp/protoc && \
cd /tmp/protoc && \
wget --quiet -O protoc.zip https://github.com/protocolbuffers/protobuf/releases/download/v3.19.3/protoc-3.19.3-linux-x86_64.zip && \
unzip protoc.zip && \
mv /tmp/protoc/bin/protoc /usr/local/bin && \
chmod a+x /usr/local/bin/protoc && \
rm -rf /tmp/protoc
- run: cargo build --manifest-path ./examples/rust/getting-started/Cargo.toml

build-and-deploy:
needs: test-examples
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout Github repo
uses: actions/checkout@v3

- name: Set up Python Virtualenv
uses: actions/setup-python@v4
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.9

- name: Setup venv
run: |
python3 -m venv .venv
.venv/bin/python -m pip install poetry

- uses: dtolnay/rust-toolchain@nightly

- name: Set up dependencies
- name: Install poetry
run: |
.venv/bin/pip install -U maturin pip
sudo apt-get update -qq
sudo apt-get install -y -qq make

- name: Install Protoc
uses: arduino/setup-protoc@v2
with:
version: "27.1"
repo-token: ${{ secrets.GITHUB_TOKEN }}
curl -sSL https://install.python-poetry.org | python3 -

- name: Install dependencies
run: |
cd libs/gl-client-py/
poetry export --without-hashes --with=docs > /tmp/requirements.txt
.venv/bin/pip install -U -r /tmp/requirements.txt

- name: Build and install gl-client-py
run: |
(cd libs/gl-client-py; ../../.venv/bin/maturin develop)
mkdir /tmp/protoc && \
cd /tmp/protoc && \
wget --quiet -O protoc.zip https://github.com/protocolbuffers/protobuf/releases/download/v3.19.3/protoc-3.19.3-linux-x86_64.zip && \
unzip protoc.zip && \
mv /tmp/protoc/bin/protoc /usr/local/bin && \
chmod a+x /usr/local/bin/protoc && \
rm -rf /tmp/protoc \

- name: Install poetry dependencies
run: poetry install --with docs

- name: Build docs
env:
DOCSBRANCH: "gh-pages"
DOCSREMOTE: "origin"
GITHUB_TOKEN: "${{ secrets.GH_PAGES_PAT }}"
run: |
PATH=$(pwd)/.venv/bin:$PATH make docs
run: mkdir -p ${GITHUB_WORKSPACE}/site/
- run: cd docs && poetry run mkdocs build --verbose --strict --clean --site-dir=${GITHUB_WORKSPACE}/site/
- run: poetry run pdoc -o ${GITHUB_WORKSPACE}/site/py glclient

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
Expand Down
Loading