From fbf585c7b6f221c02dbfb419d16d0b51c4d17490 Mon Sep 17 00:00:00 2001 From: Kevin Griffin Date: Wed, 23 Aug 2023 14:07:08 +0000 Subject: [PATCH] adds workflow to generate docs on push to main (#93) * adds workflow to generate docs on push to main --- .github/workflows/main.yml | 6 ++-- .github/workflows/update-documentation.yml | 39 ++++++++++++++++++++++ 2 files changed, 42 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/update-documentation.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f2a18f0c..e62de9b4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,12 +11,12 @@ on: workflow_dispatch: jobs: build: - name: Build, lint, and test on Node ${{ matrix.node }} and ${{ matrix.os }} + name: Build, lint, and test on Node 18.12.1 and ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: matrix: - os: [ macOS-latest] + os: [ macOS-latest, ubuntu-latest] steps: - name: Checkout repo @@ -38,4 +38,4 @@ jobs: - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v3 env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/update-documentation.yml b/.github/workflows/update-documentation.yml new file mode 100644 index 00000000..2edf1941 --- /dev/null +++ b/.github/workflows/update-documentation.yml @@ -0,0 +1,39 @@ +name: CI +on: + push: + branches: + - 'main' + workflow_dispatch: +jobs: + update: + name: Updater documentation + + runs-on: ubuntu-latest + + steps: + - name: Checkout repo + uses: actions/checkout@v2 + + - uses: actions/setup-node@v2 + with: + node-version: '18.12.1' + cache: 'npm' + + - name: build + run: | + npm cache clean --force + npm set registry https://registry.npmjs.org/ + npm i + npx typedoc src/index.ts + + - name: Commit files + run: | + git config --local user.email "github-actions[bot]@users.noreply.github.com" + git config --local user.name "github-actions[bot]" + git add . + git commit -a -m "Update documentation" + - name: Push changes + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + branch: ${{ github.ref }} \ No newline at end of file