-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c855f9a
commit d4aad2e
Showing
4 changed files
with
97 additions
and
0 deletions.
There are no files selected for viewing
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
# 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_call: | ||
inputs: | ||
package_dir: | ||
required: true | ||
type: string | ||
docs_entrypoint: | ||
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: Debug | ||
run: echo $REQUIREMENTS_FILE | ||
|
||
- name: Install Requirements From Egg Info | ||
run: python -m pip install -r $REQUIREMENTS_FILE | ||
|
||
- name: Install Package to Document | ||
run: python -m pip install -e ${{ inputs.package_dir }} | ||
|
||
- name: Install pdoc | ||
run: python -m pip install --upgrade pdoc | ||
|
||
- name: Build Docs | ||
run: python -m pdoc ${{ inputs.docs_entrypoint }} --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" |
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 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