Added a new GitHub action to auto-generate SDK references. #4
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: sdk-reference | |
on: | |
push: | |
branches: | |
- v2.0.0-beta | |
pull_request: | |
jobs: | |
docs: | |
runs-on: ubuntu-latest | |
environment: | |
name: sdk-reference | |
url: ${{ steps.deploy.outputs.url }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Java 8 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: "8" | |
distribution: "corretto" | |
cache: gradle | |
- 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_ENV | |
- 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 }} |