Skip to content
name: Create Docusaurus Page from Issue
on:
issues:
types: [opened, labeled]
jobs:
create-docusaurus-page:
runs-on: ubuntu-latest
if: github.event.label.name == 'new-page'
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Create Branch
run: |
ISSUE_NUMBER=${{ github.event.issue.number }}
BRANCH_NAME="new-page-${ISSUE_NUMBER}"
git checkout -b $BRANCH_NAME
git push origin $BRANCH_NAME
- name: Create Docusaurus File
run: |
ISSUE_NUMBER=${{ github.event.issue.number }}
TITLE=${{ github.event.issue.body.title }}
DESCRIPTION=${{ github.event.issue.body.description }}
SIDEBAR_POSITION=${{ github.event.issue.body.sidebar_position }}
CONTENT=${{ github.event.issue.body.content }}
FILENAME="./docs/new-page-${ISSUE_NUMBER}.md"
echo "---" > $FILENAME
echo "title: $TITLE" >> $FILENAME
echo "description: $DESCRIPTION" >> $FILENAME
echo "sidebar_position: $SIDEBAR_POSITION" >> $FILENAME
echo "---" >> $FILENAME
echo "$CONTENT" >> $FILENAME
git add $FILENAME
git commit -m "Create new Docusaurus page from issue $ISSUE_NUMBER"
git push origin $BRANCH_NAME
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
title: "New Docusaurus Page from Issue ${{ github.event.issue.number }}"
branch: "new-page-${{ github.event.issue.number }}"
base: "Production"