Add GitHub Actions workflow for TypeDoc deployment
Introduced a new GitHub Actions workflow to automate the deployment of documentation using TypeDoc and test coverage to GitHub Pages. The workflow triggers on pushes to the main branch or manually. Steps include checking out the repository, setting up Node.js, installing dependencies, running tests, generating TypeDoc documentation, and deploying the output to the gh-pages branch.
This commit is contained in:
48
.github/workflows/DeployTypeDoc.yml
vendored
Normal file
48
.github/workflows/DeployTypeDoc.yml
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
name: Deploy Documentation
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
workflow_dispatch: # Allows manual execution of the workflow.
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20.8.0'
|
||||
|
||||
- name: Install Dependencies
|
||||
run: npm install
|
||||
|
||||
- name: Run Tests and Generate Coverage
|
||||
run: |
|
||||
npm run test:verbose || echo "Ignoring test failures"
|
||||
|
||||
- name: Run TypeDoc
|
||||
run: npx typedoc
|
||||
|
||||
- name: Deploy to GitHub Pages
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
git config --global user.name 'github-actions[bot]'
|
||||
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
|
||||
git clone --single-branch --branch gh-pages https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} gh-pages
|
||||
rm -rf gh-pages/*
|
||||
cp -r .locale/docs/* gh-pages/
|
||||
mkdir -p gh-pages/coverage
|
||||
cp -r .locale/coverage/* gh-pages/coverage/
|
||||
cd gh-pages
|
||||
git add .
|
||||
git commit -m 'Deploy documentation and coverage'
|
||||
git push origin gh-pages
|
Reference in New Issue
Block a user