sync doc file with envd #635
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: sync doc file with envd | |
on: | |
repository_dispatch: | |
types: [on-demand-test] | |
workflow_dispatch: | |
schedule: | |
- cron: '0 2 * * *' | |
jobs: | |
sync_file: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' | |
- uses: actions/setup-go@v3 | |
with: | |
go-version: '1.19' | |
- name: Checkout Envd-docs | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
path: envd-docs | |
- name: Checkout Envd | |
uses: actions/checkout@v3 | |
with: | |
repository: 'tensorchord/envd' | |
fetch-depth: 1 | |
path: envd | |
- run: | | |
mkdir -p envd-docs/hack/api/ | |
cp -r envd/envd/api/* envd-docs/hack/api/ | |
- name: Checkout Envd lib | |
uses: actions/checkout@v3 | |
with: | |
repository: 'tensorchord/envdlib' | |
fetch-depth: 1 | |
path: envdlib | |
- run: | | |
mkdir -p envd-docs/hack/api/lib/ | |
cp -r envdlib/src/* envd-docs/hack/api/lib/ | |
- name: Install latest envd | |
run: | | |
pushd envd | |
make | |
cp bin/envd /usr/local/bin/envd | |
popd | |
- name: Generate API docs | |
run: | | |
pushd envd-docs | |
python -m pip install -r hack/api/requirement.txt | |
make generate-api-ref | |
popd | |
- name: Copy API docs to zh docs | |
run: | | |
pushd envd-docs | |
cp -r docs/api docs-zh/ | |
popd | |
- name: Generate CLI docs | |
run: | | |
pushd envd-docs | |
make generate-cli-ref | |
popd | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v4 | |
with: | |
path: envd-docs | |
add-paths: | | |
hack/api | |
docs/* | |
branch: sync_envd | |
title: Auto sync doc with envd repo | |
signoff: true |