docs: Fixes and adding front matter to example README files (#610) #39
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: "Docs" | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- master | |
paths: | |
- 'label_studio_ml/examples/**/README.md' | |
concurrency: | |
group: "Docs" | |
cancel-in-progress: true | |
env: | |
DOCS_REPO_NAME: "label-studio" | |
DOCS_REPO_PATH: "label-studio" | |
DOCS_REPO_PR_BRANCH_NAME: "docs-ml-backend-preview" | |
DOCS_REPO_PR_REVIEWERS: "caitlinwheeless" | |
ML_REPO_PATH: "label-studio-ml-backend" | |
COMMIT_MESSAGE: "docs: Update label-studio-ml-backend docs" | |
jobs: | |
docs: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: hmarr/[email protected] | |
- name: Checkout Actions Hub | |
uses: actions/checkout@v4 | |
with: | |
token: "${{ secrets.GIT_PAT }}" | |
repository: "HumanSignal/actions-hub" | |
path: "./.github/actions-hub" | |
- name: Git Configure | |
uses: ./.github/actions-hub/actions/git-configure | |
with: | |
username: "${{ github.event.sender.login }}" | |
- name: Find or Create Branch | |
uses: ./.github/actions-hub/actions/github-find-or-create-branch | |
id: get-branch | |
with: | |
repository: "${{ github.repository_owner }}/${{ env.DOCS_REPO_NAME }}" | |
base_branch_name: "develop" | |
branch_name: "${{ env.DOCS_REPO_PR_BRANCH_NAME }}" | |
github-token: "${{ secrets.GIT_PAT }}" | |
- name: Checkout ML | |
uses: actions/checkout@v4 | |
with: | |
token: "${{ secrets.GIT_PAT }}" | |
path: "${{ env.ML_REPO_PATH }}" | |
- name: Checkout LSO | |
uses: actions/checkout@v4 | |
with: | |
token: "${{ secrets.GIT_PAT }}" | |
repository: "${{ github.repository_owner }}/${{ env.DOCS_REPO_NAME }}" | |
ref: "${{ steps.get-branch.outputs.branch_name }}" | |
path: "${{ env.DOCS_REPO_PATH }}" | |
- name: Generate Docs | |
env: | |
ML_REPO_PATH: "${{ github.workspace }}/${{ env.ML_REPO_PATH }}" | |
working-directory: "${{ env.DOCS_REPO_PATH }}" | |
run: python 'scripts/update_ml_tutorials.py' | |
- name: Git Commit | |
working-directory: "${{ env.DOCS_REPO_PATH }}" | |
run: | | |
git add 'docs/source/tutorials' || true | |
git add 'docs/source/guide/ml_tutorials.html' || true | |
git status -s | |
git commit -m '${{ env.COMMIT_MESSAGE }}' -m 'Workflow run: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}' || true | |
- name: Git Push | |
uses: ./.github/actions-hub/actions/git-push | |
with: | |
working_directory: "${{ env.DOCS_REPO_PATH }}" | |
- name: Find or Create Pull Request | |
uses: ./.github/actions-hub/actions/github-find-or-create-pull-request | |
id: get-pull-request | |
with: | |
title: "${{ env.COMMIT_MESSAGE }}" | |
repository: "${{ github.repository_owner }}/${{ env.DOCS_REPO_NAME }}" | |
base_branch_name: "develop" | |
branch_name: "${{ steps.get-branch.outputs.branch_name }}" | |
github-token: "${{ secrets.GIT_PAT }}" | |
- name: Add Pull Request Reviewers | |
uses: ./.github/actions-hub/actions/github-add-pull-request-reviewers | |
id: add-pull-request-reviewers | |
with: | |
repository: "${{ github.repository_owner }}/${{ env.DOCS_REPO_NAME }}" | |
pullrequest_number: "${{ fromJSON(steps.get-pull-request.outputs.pull).number }}" | |
reviewers: "${{ env.DOCS_REPO_PR_REVIEWERS }}" | |
github-token: "${{ secrets.GIT_PAT }}" | |
- name: Set notice | |
run: echo "::notice::Pull Request ${{ fromJSON(steps.get-pull-request.outputs.pull).html_url }}" |