forked from ReactiveCircus/FlowBinding
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build website and generate API docs.
- Loading branch information
1 parent
d063926
commit bfa8800
Showing
21 changed files
with
273 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
REPO="[email protected]:ReactiveCircus/FlowBinding.git" | ||
REMOTE_NAME="origin" | ||
DIR=temp-clone | ||
|
||
if [ -n "${CI}" ]; then | ||
REPO="https://github.com/${GITHUB_REPOSITORY}.git" | ||
fi | ||
|
||
# Clone project into a temp directory | ||
rm -rf $DIR | ||
git clone "$REPO" $DIR | ||
cd $DIR | ||
|
||
# Generate API docs | ||
./gradlew dokka | ||
|
||
# Copy *.md files into docs directory | ||
cp README.md docs/index.md | ||
mkdir -p docs/flowbinding-android && cp flowbinding-android/README.md docs/flowbinding-android/index.md | ||
mkdir -p docs/flowbinding-activity && cp flowbinding-activity/README.md docs/flowbinding-activity/index.md | ||
mkdir -p docs/flowbinding-appcompat && cp flowbinding-appcompat/README.md docs/flowbinding-appcompat/index.md | ||
mkdir -p docs/flowbinding-core && cp flowbinding-core/README.md docs/flowbinding-core/index.md | ||
mkdir -p docs/flowbinding-drawerlayout && cp flowbinding-drawerlayout/README.md docs/flowbinding-drawerlayout/index.md | ||
mkdir -p docs/flowbinding-lifecycle && cp flowbinding-lifecycle/README.md docs/flowbinding-lifecycle/index.md | ||
mkdir -p docs/flowbinding-material && cp flowbinding-material/README.md docs/flowbinding-material/index.md | ||
mkdir -p docs/flowbinding-navigation && cp flowbinding-navigation/README.md docs/flowbinding-navigation/index.md | ||
mkdir -p docs/flowbinding-preference && cp flowbinding-preference/README.md docs/flowbinding-preference/index.md | ||
mkdir -p docs/flowbinding-recyclerview && cp flowbinding-recyclerview/README.md docs/flowbinding-recyclerview/index.md | ||
mkdir -p docs/flowbinding-swiperefreshlayout && cp flowbinding-swiperefreshlayout/README.md docs/flowbinding-swiperefreshlayout/index.md | ||
mkdir -p docs/flowbinding-viewpager2 && cp flowbinding-viewpager2/README.md docs/flowbinding-viewpager2/index.md | ||
cp CHANGELOG.md docs/changelog.md | ||
|
||
# If on CI, configure git remote with access token | ||
if [ -n "${CI}" ]; then | ||
REMOTE_NAME="https://x-access-token:${DEPLOY_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" | ||
git config --global user.name "${GITHUB_ACTOR}" | ||
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com" | ||
git remote add deploy "$REMOTE_NAME" | ||
git fetch deploy && git fetch deploy gh-pages:gh-pages | ||
fi | ||
|
||
# Build the website and deploy to GitHub Pages | ||
mkdocs gh-deploy --remote-name "$REMOTE_NAME" | ||
|
||
# Delete temp directory | ||
cd .. | ||
rm -rf $DIR |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Deploy Website | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
paths: | ||
- '**.md' | ||
- 'mkdocs.yml' | ||
|
||
jobs: | ||
deploy-website: | ||
name: Generate API docs and deploy website | ||
runs-on: macOS-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: gradle/wrapper-validation-action@v1 | ||
- uses: actions/cache@v1 | ||
with: | ||
path: ~/.gradle/caches | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }} | ||
restore-keys: ${{ runner.os }}-gradle- | ||
- run: | | ||
pip3 install mkdocs mkdocs-material mkdocs-minify-plugin pymdown-extensions | ||
.buildscript/deploy_website.sh | ||
env: | ||
CI: true | ||
JAVA_TOOL_OPTIONS: -Xmx3g | ||
GRADLE_OPTS: -Dorg.gradle.daemon=false -Dorg.gradle.workers.max=2 -Dkotlin.incremental=false -Dkotlin.compiler.execution.strategy=in-process | ||
DEPLOY_TOKEN: ${{ secrets.GH_DEPLOY_TOKEN }} |
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
This file was deleted.
Oops, something went wrong.
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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
site_name: 'FlowBinding' | ||
site_description: "Kotlin Coroutines Flow binding APIs for Android's platform and unbundled UI widgets, inspired by RxBinding." | ||
site_author: 'Yang Chen' | ||
site_url: 'https://reactivecircus.github.io/FlowBinding' | ||
remote_branch: gh-pages | ||
|
||
repo_name: 'FlowBinding' | ||
repo_url: 'https://github.com/ReactiveCircus/FlowBinding' | ||
|
||
copyright: 'Copyright © 2019 Yang Chen' | ||
|
||
theme: | ||
name: 'material' | ||
language: 'en' | ||
favicon: 'images/reactive_cirrus_logo.png' | ||
logo: 'images/reactive_cirrus_logo.png' | ||
palette: | ||
primary: 'white' | ||
accent: 'white' | ||
font: | ||
text: 'Fira Sans' | ||
code: 'Fira Code' | ||
|
||
extra: | ||
social: | ||
- type: 'github' | ||
link: 'https://github.com/ReactiveCircus/FlowBinding' | ||
|
||
nav: | ||
- 'Overview': index.md | ||
- 'Platform Bindings': flowbinding-android/index.md | ||
- 'AndroidX Activity Bindings': flowbinding-activity/index.md | ||
- 'AndroidX AppCompat Bindings': flowbinding-appcompat/index.md | ||
- 'AndroidX Core Bindings': flowbinding-core/index.md | ||
- 'AndroidX DrawerLayout Bindings': flowbinding-drawerlayout/index.md | ||
- 'AndroidX Lifecycle Bindings': flowbinding-lifecycle/index.md | ||
- 'AndroidX Navigation Component Bindings': flowbinding-navigation/index.md | ||
- 'AndroidX Preference Bindings': flowbinding-preference/index.md | ||
- 'AndroidX RecyclerView Bindings': flowbinding-recyclerview/index.md | ||
- 'AndroidX SwipeRefreshLayout Bindings': flowbinding-swiperefreshlayout/index.md | ||
- 'AndroidX ViewPager2 Bindings': flowbinding-viewpager2/index.md | ||
- 'Material Components Bindings': flowbinding-material/index.md | ||
- 'Change Log': changelog.md | ||
- 'API': | ||
- 'flowbinding-activity': api/flowbinding-activity/index.md | ||
- 'flowbinding-android': api/flowbinding-android/index.md | ||
- 'flowbinding-appcompat': api/flowbinding-appcompat/index.md | ||
- 'flowbinding-common': api/flowbinding-common/index.md | ||
- 'flowbinding-core': api/flowbinding-core/index.md | ||
- 'flowbinding-drawerlayout': api/flowbinding-drawerlayout/index.md | ||
- 'flowbinding-lifecycle': api/flowbinding-lifecycle/index.md | ||
- 'flowbinding-material': api/flowbinding-material/index.md | ||
- 'flowbinding-navigation': api/flowbinding-navigation/index.md | ||
- 'flowbinding-preference': api/flowbinding-preference/index.md | ||
- 'flowbinding-recyclerview': api/flowbinding-recyclerview/index.md | ||
- 'flowbinding-swiperefreshlayout': api/flowbinding-swiperefreshlayout/index.md | ||
- 'flowbinding-viewpager2': api/flowbinding-viewpager2/index.md | ||
|
||
markdown_extensions: | ||
- admonition | ||
- smarty | ||
- codehilite: | ||
guess_lang: false | ||
linenums: True | ||
- footnotes | ||
- meta | ||
- toc: | ||
permalink: true | ||
- pymdownx.betterem: | ||
smart_enable: all | ||
- pymdownx.caret | ||
- pymdownx.details | ||
- pymdownx.inlinehilite | ||
- pymdownx.magiclink | ||
- pymdownx.smartsymbols | ||
- pymdownx.superfences | ||
- tables | ||
|
||
plugins: | ||
- search | ||
- minify: | ||
minify_html: true |