-
-
Notifications
You must be signed in to change notification settings - Fork 159
50 lines (49 loc) · 1.73 KB
/
update-docs-in-website.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: Update latest CLI documentation in the website
on:
push:
branches:
- 'master'
paths:
- 'docs/*.md'
workflow_dispatch:
jobs:
Make-PR:
name: Make PR on website repository with updated latest CLI documentation
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
steps:
- name: Checkout Current repository
uses: actions/checkout@v3
with:
path: cli
- 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-cli-docs-${{ github.sha }}
- name: Copy cli folder from Current Repo to Another
working-directory: ./website
run: |
mkdir -p ./markdown/docs/tools/cli
printf "%s\ntitle: CLI\nweight: 10\n%s" "---" "---"> ../cli/docs/_section.md
mv ../cli/docs/*.md ./markdown/docs/tools/cli
- name: Commit and push
working-directory: ./website
run: |
git add .
git commit -m "docs(cli): update latest cli docs"
git push https://${{ env.GITHUB_TOKEN }}@github.com/asyncapi/website
- name: Create PR
working-directory: ./website
run: |
gh pr create --title "docs(cli): update latest cli documentation" --body "Updated cli documentation is available and this PR introduces update to cli folder on the website" --head "update-cli-docs-${{ github.sha }}"