cloudstream/.github/workflows/generate_dokka.yml

73 lines
1.9 KiB
YAML
Raw Permalink Normal View History

2022-08-13 14:12:41 +00:00
name: Dokka
2022-08-13 14:09:08 +00:00
# https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#concurrency
concurrency:
2022-08-13 14:13:30 +00:00
group: "dokka"
2022-08-13 14:09:08 +00:00
cancel-in-progress: true
on:
push:
branches:
# choose your default branch
- master
- main
paths-ignore:
- '*.md'
jobs:
build:
runs-on: ubuntu-latest
steps:
2022-08-15 10:27:22 +00:00
- name: Generate access token
id: generate_token
uses: tibdex/github-app-token@v2
2022-08-15 10:27:22 +00:00
with:
app_id: ${{ secrets.GH_APP_ID }}
private_key: ${{ secrets.GH_APP_KEY }}
repository: "recloudstream/dokka"
2022-08-13 14:09:08 +00:00
- name: Checkout
uses: actions/checkout@master
with:
path: "src"
- name: Checkout dokka
uses: actions/checkout@master
with:
2022-08-15 10:27:22 +00:00
repository: "recloudstream/dokka"
2022-08-13 14:09:08 +00:00
path: "dokka"
2022-08-15 10:27:22 +00:00
token: ${{ steps.generate_token.outputs.token }}
2022-08-13 14:09:08 +00:00
- name: Clean old builds
2022-08-15 10:27:22 +00:00
run: |
cd $GITHUB_WORKSPACE/dokka/
2022-09-20 20:01:30 +00:00
rm -rf "./-cloudstream"
2022-08-13 14:09:08 +00:00
- name: Setup JDK 17
uses: actions/setup-java@v4
2022-08-13 14:09:08 +00:00
with:
java-version: 17
distribution: 'adopt'
2022-08-13 14:09:08 +00:00
- name: Setup Android SDK
uses: android-actions/setup-android@v3
2022-08-13 14:09:08 +00:00
- name: Generate Dokka
run: |
2022-08-15 10:27:22 +00:00
cd $GITHUB_WORKSPACE/src/
2022-08-13 14:12:41 +00:00
chmod +x gradlew
./gradlew app:dokkaHtml
2022-08-13 14:09:08 +00:00
- name: Copy Dokka
run: |
2022-08-15 10:27:22 +00:00
cp -r $GITHUB_WORKSPACE/src/app/build/dokka/html/* $GITHUB_WORKSPACE/dokka/
2022-08-13 14:09:08 +00:00
- name: Push builds
run: |
cd $GITHUB_WORKSPACE/dokka
2022-08-15 10:38:25 +00:00
touch .nojekyll
2022-08-15 10:40:51 +00:00
git config --local user.email "111277985+recloudstream[bot]@users.noreply.github.com"
2022-08-15 10:38:25 +00:00
git config --local user.name "recloudstream[bot]"
2022-08-13 14:09:08 +00:00
git add .
2022-08-15 10:27:22 +00:00
git commit --amend -m "Generate dokka for recloudstream/cloudstream@${GITHUB_SHA}" || exit 0 # do not error if nothing to commit
2022-08-13 14:12:41 +00:00
git push --force