Skip to content

Added a new GitHub action to auto-generate SDK references. #2

Added a new GitHub action to auto-generate SDK references.

Added a new GitHub action to auto-generate SDK references. #2

Workflow file for this run

name: sdk-reference
on:
push:
branches:
- v2.0.0-beta
pull_request:
jobs:
docs:
runs-on: ubuntu-latest
environment:
name: sdk-reference
url: ${{ steps.deply.outputs.url }}
steps:
- uses: actions/checkout@v3
- name: Setup Java 8
uses: actions/setup-java@v3
with:
java-version: "8"
distribution: "corretto"
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build SDK refernece
run: ./gradlew dokkaHtml
- name: Set env BRANCH
run: echo "BRANCH=$(echo $GITHUB_REF | cut -d'/' -f 3)" >> $GITHUB_EN
- name: Set env CLOUDFLARE_BRANCH
run: |
if [[ $BRANCH == 'v2.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-java-sdk-reference
directory: build/dokka/html
wranglerVersion: "3"
branch: ${{ env.CLOUDFLARE_BRANCH }}