Workflow file for this run
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
# This workflow will upload a Python Package using Twine when a release is created | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries | ||
# This workflow uses actions that are not certified by GitHub. | ||
# They are provided by a third-party and are governed by | ||
# separate terms of service, privacy policy, and support | ||
# documentation. | ||
name: Build Docs | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
package_dir: | ||
required: true | ||
type: string | ||
package_name: | ||
required: true | ||
type: string | ||
test: | ||
required: false | ||
type: boolean | ||
default: false | ||
workflow_call: | ||
inputs: | ||
package_dir: | ||
required: true | ||
type: string | ||
package_name: | ||
required: true | ||
type: string | ||
secrets: | ||
PYPI_API_TOKEN: | ||
required: true | ||
DOCS_DEPLOY_AWS_ACCESS_KEY: | ||
required: true | ||
DOCS_DEPLOY_AWS_API_SECRET: | ||
required: true | ||
permissions: | ||
contents: read | ||
jobs: | ||
docs: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
- name: Install Package to Document | ||
run: python -m pip install ${{ inputs.package_dir }}/ | ||
- name: Download ffi | ||
run: '[[ ${{ inputs.package_name }} = \'livekit.rtc\' ]] && pip install requests && python livekit-rtc/rust-sdks/download_ffi.py --output $(python -m site --user-site)/livekit/rtc/resources' | ||
- name: Install pdoc | ||
run: pip install --upgrade pdoc | ||
- name: Build Docs | ||
run: python -m pdoc ${{ inputs.package_name }} --docformat=google --output-dir docs | ||
- name: S3 Upload | ||
run: aws s3 cp docs/ s3://livekit-docs/${{ inputs.package_dir }} --recursive | ||
env: | ||
AWS_ACCESS_KEY_ID: ${{ secrets.DOCS_DEPLOY_AWS_ACCESS_KEY }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.DOCS_DEPLOY_AWS_API_SECRET }} | ||
AWS_DEFAULT_REGION: "us-east-1" |