From 187b39e7c596f2af4431e6e9764cdad73114b57c Mon Sep 17 00:00:00 2001 From: Max P Date: Fri, 16 Aug 2024 11:40:24 +0200 Subject: [PATCH] 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. --- .github/workflows/DeployTypeDoc.yml | 48 +++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/DeployTypeDoc.yml diff --git a/.github/workflows/DeployTypeDoc.yml b/.github/workflows/DeployTypeDoc.yml new file mode 100644 index 0000000..13f6784 --- /dev/null +++ b/.github/workflows/DeployTypeDoc.yml @@ -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