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