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: add update-docs workflow #258

Merged
merged 5 commits into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from 3 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
18 changes: 18 additions & 0 deletions .github/workflows/global-replicator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,4 +179,22 @@ jobs:
committer_username: asyncapi-bot
committer_email: [email protected]
commit_message: "ci: update of files from global .github repo"
bot_branch_name: bot/update-files-from-global-repo

replicate_docs_workflow:
if: startsWith(github.repository, 'asyncapi/')
name: Replicate update-docs workflow to repositories
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Replicating file
uses: derberg/manage-files-in-multiple-repositories@beecbe897cf5ed7f3de5a791a3f2d70102fe7c25
with:
github_token: ${{ secrets.GH_TOKEN }}
patterns_to_include: .github/workflows/update-docs-on-docs-commit.yml
Shurtu-gal marked this conversation as resolved.
Show resolved Hide resolved
topics_to_include: autogenerate-docs
Shurtu-gal marked this conversation as resolved.
Show resolved Hide resolved
committer_username: asyncapi-bot
committer_email: [email protected]
commit_message: "ci: update of files from global .github repo"
bot_branch_name: bot/update-files-from-global-repo
42 changes: 42 additions & 0 deletions .github/workflows/update-docs-on-docs-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# This workflow is centrally managed in https:/asyncapi/.github/
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo

# The given workflow is responsible for generating docs and creating PR with them when there is a commit with docs: prefix

# This workflow will be updated in all repos with the topic autogenerate-docs
Shurtu-gal marked this conversation as resolved.
Show resolved Hide resolved

name: 'Update generated parts of documentation on docs: commits'

on:
push:
branches:
- master

jobs:
docs-gen:
name: 'Generate docs and create PR'
runs-on: ubuntu-latest
# PR should be created within this GH action only if it is a docs: commit
# Otherwise it will conflict with release workflow
if: startsWith(github.event.commits[0].message, 'docs:')
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
Shurtu-gal marked this conversation as resolved.
Show resolved Hide resolved
- name: Install dependencies
run: npm ci
- name: Regenerate docs
run: npm run generate:assets
Shurtu-gal marked this conversation as resolved.
Show resolved Hide resolved
- name: Create Pull Request with updated docs
uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38 # uses 5.0.2 https:/peter-evans/create-pull-request/releases/tag/v5.0.2
with:
token: ${{ secrets.GH_TOKEN }}
commit-message: 'chore: update generated docs'
committer: asyncapi-bot <[email protected]>
author: asyncapi-bot <[email protected]>
title: 'chore: update generated docs'
body: 'Update of docs that are generated and were forgotten on PR level.'
branch: gen-docs-update
Shurtu-gal marked this conversation as resolved.
Show resolved Hide resolved