-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from airtai/add-pages-deploy
Add pages deploy
- Loading branch information
Showing
2 changed files
with
50 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Build FastStream Docs | ||
on: | ||
push: | ||
branches: | ||
- master | ||
- main | ||
|
||
jobs: | ||
deploy_docs: | ||
name: Deploy FastStream Docs to GitHub Pages | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ inputs.version }} | ||
- name: Install Dependencies | ||
shell: bash | ||
run: | | ||
set -ux | ||
python -m pip install --upgrade pip | ||
test -f pyproject.toml && pip install -e "." || echo "pyproject.toml doesn't exists" | ||
test -f requirements.txt && pip install -r requirements.txt || echo "requirements.txt doesn't exists" | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
- name: Generate asyncapi.yaml | ||
shell: bash | ||
run: | | ||
faststream docs gen --yaml app.application:app | ||
- name: Generate AsyncAPI Docs | ||
shell: bash | ||
run: | | ||
npx --version | ||
npx -y -p @asyncapi/generator ag --version | ||
mkdir asyncapi_docs | ||
npx -y -p @asyncapi/generator ag asyncapi.yaml @asyncapi/html-template -o asyncapi_docs | ||
- name: Deploy to GitHub Pages | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
force_orphan: true | ||
publish_dir: ./asyncapi_docs | ||
# The following lines assign commit authorship to the official GH-Actions bot for deploys to `gh-pages` branch. | ||
# You can swap them out with your own user credentials. | ||
user_name: github-actions[bot] | ||
user_email: 41898282+github-actions[bot]@users.noreply.github.com |
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