Skip to content

Commit

Permalink
doc: add instruction for using GitHub Actions (#4071)
Browse files Browse the repository at this point in the history
Co-authored-by: Sherlock Xu <65327072+Sherlock113@users.noreply.github.com>
Co-authored-by: Aaron Pham <29749331+aarnphm@users.noreply.github.com>
  • Loading branch information
3 people committed Jul 25, 2023
1 parent df72db8 commit 4db2217
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
23 changes: 23 additions & 0 deletions docs/source/data/workflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Update Bento Deployment
on:
push:
tags:
- v*

jobs:
build_and_deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'pip'

- name: Build and Deploy
uses: bentoml/deploy-bento-action@main
with:
cloud_api_token: ${{ secrets.CLOUD_API_TOKEN }}
cloud_endpoint: ${{ secrets.CLOUD_ENDPOINT }}
deployment_name: test-iris
16 changes: 16 additions & 0 deletions docs/source/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,22 @@ specific for ML, the BentoML team has also created Yatai and bentoctl:
Learn more about different deployment options with BentoML from the
:doc:`concepts/deploy` page.
Using GitHub Actions to Boost Your Workflow
-------------------------------------------
BentoML provides a GitHub Action to help you automate the process of building Bentos and deploying them to the cloud.
To create a GitHub Actions workflow, you need to first define a workflow file as below:
.. literalinclude:: ./data/workflow.yaml
:language: yaml
The action [`bentoml/deploy-bento-action`](https://github.com/bentoml/deploy-bento-action) requires `cloud_api_token` and `cloud_endpoint`, which you can set the [repository secrets](https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository) to make sure the job has correct privilege.
You can get more details about this file in :ref:`Deploying Your Bento <bentocloud/how-tos/deploy-bentos:Deploying Your Bento>` and `the GitHub Actions documentation <https://docs.github.com/en/actions/quickstart>`_.
With this workflow, every time you push changes to the repository, a new Bento will be built and rolled out to the existing deployment.
Read the usage and available input parameters of this action in the `Action README <https://github.com/bentoml/deploy-bento-action>`_.
----
Expand Down

0 comments on commit 4db2217

Please sign in to comment.