Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added github action to generate SDK references #475

Merged
merged 2 commits into from
Aug 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"]
}
Loading