Skip to content

docs: channel object / $ref note. (#826) #28

docs: channel object / $ref note. (#826)

docs: channel object / $ref note. (#826) #28

Workflow file for this run

name: Update latest specification document in the website
on:
push:
branches:
- 'master'
paths:
- 'spec/asyncapi.md'
jobs:
Make-PR:
name: Make PR on website repository with updated latest spec
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
steps:
- name: Checkout Current repository
uses: actions/checkout@v3
with:
path: spec
- 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 [email protected]
- name: Get latest release
id: latest_version
uses: abatilo/release-info-action@5774bec4e3eabad433b4ae8f625e83afa0e7bb22 # 1.3.2 release https://github.com/abatilo/release-info-action/releases/tag/v1.3.2
with:
owner: asyncapi
repo: spec
- name: Create branch
working-directory: ./website
run: |
git checkout -b update-spec-${{ steps.latest_version.outputs.latest_tag }}
- name: Copy Spec file from Current Repo to Another
working-directory: ./website
run: |
cp ../spec/spec/asyncapi.md ./pages/docs/reference/specification/${{ steps.latest_version.outputs.latest_tag }}.md
- name: Remove Table of Contents from Spec
uses: actions/github-script@v6
with:
github-token: ${{ env.GITHUB_TOKEN }}
script: |
const script = require('./spec/.github/scripts/remove-toc');
script(`${{ steps.latest_version.outputs.latest_tag }}`);
- name: Commit and push
working-directory: ./website
run: |
git add .
git commit -m "docs(spec): update latest specification"
git push https://${{ env.GITHUB_TOKEN }}@github.com/asyncapi/website
- name: Create PR
working-directory: ./website
run: |
gh pr create --title "docs(spec): update latest specification" --body "Updated specification is available and this PR introduces update to specification document on the website" --head "update-spec-${{ steps.latest_version.outputs.latest_tag }}"