Skip to content

Commit

Permalink
your message
Browse files Browse the repository at this point in the history
  • Loading branch information
bint-Eve committed Jan 11, 2025
1 parent e343b0c commit 97c33ab
Show file tree
Hide file tree
Showing 19 changed files with 156 additions and 512 deletions.
88 changes: 88 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -449,3 +449,91 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}
GITHUB_REPOSITORY: ${{ github.repository }}

generate-docs:
name: Generate Auto Documentation
permissions:
contents: write

runs-on: ubuntu-latest
needs: [Code-Quality-Checks, Test-Application, Start-App-Without-Docker, Docker-Start-Check]

steps:
# Step 1: Checkout the code
- name: Checkout Code
uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}

# Step 2: Setup Node.js environment
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22.x'
cache: 'npm'

# Step 3: Install dependencies
- name: Install Dependencies
run: |
npm ci
npm install -g typedoc typedoc-plugin-markdown
# Step 4: Generate Documentation
- name: Generate Documentation
run: |
typedoc \
--out docs/docs/auto-docs \
--plugin typedoc-plugin-markdown \
--theme markdown \
--tsconfig tsconfig.json \
--excludePrivate \
--excludeProtected \
--excludeExternals \
--hideGenerator \
--categorizeByGroup true \
--entryPointStrategy expand \
--entryPoints "src/**/*.ts" "src/**/*.tsx" \
--exclude "**/*.{test,spec,stories}.{ts,tsx}" \
--exclude "**/__tests__/**" \
--exclude "**/__mocks__/**" \
--exclude "**/node_modules/**" \
--cleanOutputDir true
# Step 5: Create placeholder documentation (only if not present)
- name: Create Placeholder Documentation
run: |
mkdir -p docs/docs/user-guide
mkdir -p docs/docs/developer-guide/reference
if [ ! -f docs/docs/user-guide/intro.md ]; then
echo "# User Guide\n\nThis section contains the user guide for Talawa Admin." > docs/docs/user-guide/intro.md
fi
if [ ! -f docs/docs/developer-guide/intro.md ]; then
echo "# Developer Guide\n\nThis section contains the developer guide for Talawa Admin." > docs/docs/developer-guide/intro.md
fi
if [ ! -f docs/docs/developer-guide/reference/README.md ]; then
echo "# API Reference\n\nThis section contains the auto-generated API documentation for Talawa Admin." > docs/docs/developer-guide/reference/README.md
fi
# Step 6: Commit Documentation Changes
- name: Commit Documentation Changes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git remote set-url origin "https://${{ github.actor }}:${GITHUB_TOKEN}@github.com/${{ github.event.pull_request.head.repo.full_name }}.git"
git fetch origin ${{ github.event.pull_request.head.ref }}
git checkout ${{ github.event.pull_request.head.ref }}
git add docs/docs/auto-docs/
git add docs/docs/developer-guide/
git add docs/docs/user-guide/
if [ -n "$(git status --porcelain)" ]; then
git commit -m "docs: update auto-generated documentation [skip ci]"
git push origin HEAD:${{ github.event.pull_request.head.ref }}
else
echo "No changes to commit."
fi
Empty file added docs/docs/auto-docs/.gitignore
Empty file.
Empty file.
4 changes: 2 additions & 2 deletions docs/docs/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ Let's discover **Docusaurus in less than 5 minutes**.

Get started by **creating a new site**.

Or **try Docusaurus immediately** with **[docusaurus.new](https://docusaurus.new)**.
Or **try Docusaurus immediately** with **[docusaurus.new]**.

### What you'll need

- [Node.js](https://nodejs.org/en/download/) version 18.0 or above:
- version 18.0 or above:
- When installing Node.js, you are recommended to check all checkboxes related to dependencies.

## Generate a new site
Expand Down
8 changes: 0 additions & 8 deletions docs/docs/tutorial-basics/_category_.json

This file was deleted.

23 changes: 0 additions & 23 deletions docs/docs/tutorial-basics/congratulations.md

This file was deleted.

34 changes: 0 additions & 34 deletions docs/docs/tutorial-basics/create-a-blog-post.md

This file was deleted.

57 changes: 0 additions & 57 deletions docs/docs/tutorial-basics/create-a-document.md

This file was deleted.

43 changes: 0 additions & 43 deletions docs/docs/tutorial-basics/create-a-page.md

This file was deleted.

31 changes: 0 additions & 31 deletions docs/docs/tutorial-basics/deploy-your-site.md

This file was deleted.

Loading

0 comments on commit 97c33ab

Please sign in to comment.