build: updated build to copy examples file #35
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Documentation | |
on: | |
push: | |
branches: | |
- 3.x | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.head_ref }} | |
fetch-depth: 0 | |
- name: Setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.x | |
- name: Install packages | |
run: npm install | |
- name: Install typescript | |
run: npm install -g typescript | |
- name: Build Typescripts | |
run: npm run compile | |
- name: Build Typedoc | |
run: npm run typedoc | |
- name: Build example markdown | |
run: node scripts/generateExample.mjs | |
- name: Add TOC | |
run: (cd docs && npx markdown-index . > toc.md) | |
- name: Upload Documentation to Wiki | |
uses: SwiftDocOrg/github-wiki-publish-action@v1 | |
with: | |
path: "docs" | |
env: | |
GH_PERSONAL_ACCESS_TOKEN: ${{ secrets.GH_WIKI_PERSONAL_ACCESS_TOKEN }} | |
- name: Copy example to root | |
run: cp docs/EXAMPLES.md EXAMPLES.md | |
- name: Commit example | |
run: | | |
git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
git add EXAMPLES.md | |
git commit -m "chore: update example markdown" | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
branch: ${{ github.head_ref }} |