Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: glee docs automation workflow #548

Merged
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .github/workflows/update-docs-in-website.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Update latest Glee documentation in the website
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the workflow and script looks good.

but did anyone try to first check manually if this is enough? Website docs will not just digest what you send that easily out of the box. I quickly looked into your docs dir and noticed:

My recommendation, try to do the same that you do here in the workflow, manually on a website, and see if your docs will render. I would suggest a prerequisite for this PR is to have a draft PR on website that showcases that after merging this PR it will work like a charm

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, I will be doing this part. Thanks

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@afzal442 Thanks! 👍 🚀

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you have no front matters in markdown files

sorry @derberg I forgot to tell you about that is you could find those on /docs/pages/* folder.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moreover, this PR is up to migrate those remaining pages to /pages/ folder. Hope that makes sense now

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

folks, you can now add get-global-docs-autoupdate topic to this repo, and ask @KhudaDad414 to run https://github.com/asyncapi/.github/actions/workflows/global-replicator.yml against this repo


on:
push:
branches:
- 'master'
paths:
- 'docs/*.md'
KhudaDad414 marked this conversation as resolved.
Show resolved Hide resolved

jobs:
Make-PR:
name: Make PR on website repository with updated latest Glee documentation
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
steps:
- name: Checkout Current repository
uses: actions/checkout@v3
with:
path: glee
- 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-glee-docs-${{ github.sha }}
- name: Copy glee folder from Current Repo to Another
working-directory: ./website
run: |
mkdir -p ./pages/docs/tools/glee
printf "%s\ntitle: Glee\nweight: 06\n%s" "---" "---"> ../glee/docs/_section.md
mv ../glee/docs/pages/*.md ./pages/docs/tools/glee
- name: Commit and push
working-directory: ./website
run: |
git add .
git commit -m "docs(glee): update latest glee docs"
git push https://${{ env.GITHUB_TOKEN }}@github.com/asyncapi/website
- name: Create PR
working-directory: ./website
run: |
gh pr create --title "docs(glee): update latest glee documentation" --body "Updated glee documentation is available and this PR introduces update to glee folder on the website" --head "update-glee-docs-${{ github.sha }}"
Loading