-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generate docstrings and deploy to branches to Staging (Website) (#731)
* test pre commit hook * test status * test on this branch * push generated docstrings and tutorials to branch * fixed syntax error * Add latest docstring and tutorial changes * add files before commit * catch commit error * separate generation from deployment * add deployment process for staging * add current branch to payload Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
0f62e0b
commit 0b583b8
Showing
8 changed files
with
285 additions
and
187 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,26 @@ | ||
name: Deploy website | ||
|
||
# Controls when the action will run. Triggers the workflow on push | ||
# events but only for the master branch | ||
on: | ||
push: | ||
branches-ignore: | ||
- master | ||
- benchmarks | ||
|
||
jobs: | ||
# This workflow contains a single job called "build" | ||
build: | ||
# The type of runner that the job will run on | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
||
# Creates dispatch event for haystack-website repo | ||
- name: Repository Dispatch | ||
uses: peter-evans/repository-dispatch@v1 | ||
with: | ||
token: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }} | ||
repository: deepset-ai/haystack-website | ||
event-type: deploy-website-staging | ||
client-payload: '{"ref": "${{ github.ref }}"}' |
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,55 @@ | ||
name: Update Docstrings and Tutorials | ||
|
||
# Controls when the action will run. Triggers the workflow on push | ||
# events but only for the master branch | ||
on: | ||
push: | ||
branches-ignore: | ||
- master | ||
- benchmarks | ||
|
||
jobs: | ||
# This workflow contains a single job called "build" | ||
build: | ||
# The type of runner that the job will run on | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token | ||
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo | ||
|
||
- name: Set up Python 3.7 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.7 | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install 'pydoc-markdown>=3.0.0,<4.0.0' | ||
pip install mkdocs | ||
pip install jupytercontrib | ||
# Generates the docstrings and tutorials so that we have the latest for the deployment | ||
- name: Generate Docstrings and Tutorials | ||
run: | | ||
cd docs/_src/api/api/ | ||
./generate_docstrings.sh | ||
cd ../../tutorials/tutorials/ | ||
python3 convert_ipynb.py | ||
cd ../../../../ | ||
git status | ||
- name: Commit files | ||
run: | | ||
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
git config --local user.name "github-actions[bot]" | ||
git add . | ||
git commit -m "Add latest docstring and tutorial changes" -a || echo "No changes to commit" | ||
- name: Push changes | ||
uses: ad-m/github-push-action@master | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
branch: ${{ github.ref }} |
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
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
Oops, something went wrong.