Skip to content

Iterating on Github Action #1

Iterating on Github Action

Iterating on Github Action #1

Workflow file for this run

# This workflow will upload a Python Package using Twine when a release is created

Check failure on line 1 in .github/workflows/build-docs.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/build-docs.yml

Invalid workflow file

`call-publish-workflow` is not a valid event name
# 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:
call-publish-workflow:
with:
package_dir: 'livekit-rtc'
package_name: 'livekit'
secrets: inherit
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
- name: Generate Egg Info
run: python ${{ inputs.package_dir }}/setup.py egg_info
- name: Find requires.txt
run: |
# Search for requirements.txt file and store its content in an environment variable
REQUIREMENTS_FILE=$(find . -type f -name "requires.txt")
echo "Found requires.txt file at: $REQUIREMENTS_FILE"
if [ -n "$REQUIREMENTS_FILE" ]; then
echo "REQUIREMENTS_FILE=$REQUIREMENTS_FILE" >> $GITHUB_ENV
else
echo "No requiress.txt file found."
fi
- name: Install Package to Document
run: python -m pip install ${{ inputs.package_dir }}/
- name: Install pdoc
run: python -m 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"