Skip to content

docs: publish AI tooling guide and migrate development docs (#2141) #32

docs: publish AI tooling guide and migrate development docs (#2141)

docs: publish AI tooling guide and migrate development docs (#2141) #32

name: Update latest generator documentation in the website
on:
push:
branches:
- 'master'
paths:
- 'apps/generator/docs/*.md'
- '.github/workflows/update-docs-in-website.yml'
jobs:
Make-PR:
name: Make PR on website repository with updated latest generator documentation
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
steps:
- name: Checkout Current repository
uses: actions/checkout@v3
with:
path: generator
- name: Checkout Another repository
uses: actions/checkout@v3
with:
repository: asyncapi/website
path: website
token: ${{ env.GITHUB_TOKEN }}
- name: Config git
run: |
git config --global user.name asyncapi-bot
git config --global user.email info@asyncapi.io
- name: Create branch
working-directory: ./website
run: |
git checkout -b update-generator-docs-${{ github.sha }}
- name: Copy generator folder from Current Repo to Another
working-directory: ./website
run: |
rm -r ./markdown/docs/tools/generator
mkdir -p ./markdown/docs/tools/generator
rm ../generator/apps/generator/docs/README.md
rm -r ../generator/apps/generator/docs/jsdoc2md-handlebars
printf "%s\ntitle: Generator\nweight: 3\n%s" "---" "---"> ../generator/apps/generator/docs/_section.md
mv ../generator/apps/generator/docs/*.md ./markdown/docs/tools/generator
- name: Commit and push
working-directory: ./website
run: |
git add .
git commit -m "docs(generator): update latest generator docs"
git push https://${{ env.GITHUB_TOKEN }}@github.com/asyncapi/website
- name: Create PR
working-directory: ./website
run: |
gh pr create --title "docs(generator): update latest generator documentation" --body "Updated generator documentation is available and this PR introduces update to generator folder on the website" --head "update-generator-docs-${{ github.sha }}"