Skip to content

Commit

Permalink
Added github action to generate SDK references (#475)
Browse files Browse the repository at this point in the history
* Generate SDK refernece GHA

* Added docs command
  • Loading branch information
AaronDDM committed Aug 11, 2023
1 parent b39b072 commit d1c21e1
Show file tree
Hide file tree
Showing 5 changed files with 252 additions and 1 deletion.
43 changes: 43 additions & 0 deletions .github/workflows/sdk-reference.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: sdk-reference

on:
push:
branches:
- v7.0.0-beta
pull_request:

jobs:
docs:
runs-on: ubuntu-latest
environment:
name: sdk-reference
url: ${{ steps.deploy.outputs.url }}
steps:
- uses: actions/checkout@v2
- name: Setup Nodejs
uses: actions/setup-node@v1
with:
node-version: 18.x
- name: Install dependencies and build
run: npm install
- name: Build docs
run: npm run build:docs
- name: Set env BRANCH
run: echo "BRANCH=$(echo $GITHUB_REF | cut -d'/' -f 3)" >> $GITHUB_ENV
- name: Set env CLOUDFLARE_BRANCH
run: |
if [[ $BRANCH == 'v7.0.0-beta' && $GITHUB_EVENT_NAME == 'push' ]]; then
echo "CLOUDFLARE_BRANCH=main" >> "$GITHUB_ENV"
else
echo "CLOUDFLARE_BRANCH=$BRANCH" >> "$GITHUB_ENV"
fi
- name: Publish to Cloudflare Pages
uses: cloudflare/pages-action@v1
id: deploy
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: nylas-nodejs-sdk-reference
directory: docs
wranglerVersion: "3"
branch: ${{ env.CLOUDFLARE_BRANCH }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ tags
CTAGS
.idea
coverage
docs
197 changes: 197 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"lint:prettier": "prettier --write '**/*.{ts,js}'",
"lint:prettier:check": "prettier --check '**/*.{ts,js}'",
"build": "tsc",
"prepare": "npm run build"
"prepare": "npm run build",
"build:docs": "typedoc --out docs"
},
"keywords": [
"email",
Expand Down Expand Up @@ -50,6 +51,8 @@
"jest": "^29.6.1",
"prettier": "^1.19.1",
"ts-jest": "^29.1.1",
"typedoc": "^0.24.8",
"typedoc-plugin-missing-exports": "^2.0.1",
"typescript": "^4.9.5"
},
"repository": {
Expand Down
7 changes: 7 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,12 @@
"resolveJsonModule": true,
"strict": true
},
"typedocOptions": {
"entryPoints": ["src/nylas.ts"],
"out": "docs",
"plugin": ["typedoc-plugin-missing-exports"],
"excludeExternals": true,
"excludePrivate": true,
},
"exclude": ["tests", "lib"]
}

0 comments on commit d1c21e1

Please sign in to comment.