refactor: migrate to new repository owner [part 4] #4
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: Generate Dokka | |
concurrency: | |
group: "Generate Dokka" | |
cancel-in-progress: true | |
on: | |
push: | |
branches: | |
- master | |
paths-ignore: | |
- '*.md' | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout App Repository | |
uses: actions/checkout@master | |
with: | |
path: "Flixclusive" | |
- name: Generate access token | |
id: generate_token | |
uses: actions/create-github-app-token@v1 | |
with: | |
app_id: ${{ secrets.APP_ID }} | |
private_key: ${{ secrets.APP_KEY }} | |
owner: Flixclusive | |
repositories: | | |
api | |
- name: Checkout API Reference Repository | |
uses: actions/checkout@master | |
with: | |
repository: 'Flixclusive/api' | |
path: 'api' | |
token: ${{ steps.generate_token.outputs.token }} | |
- name: Setup Android SDK | |
run: | | |
${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager "build-tools;29.0.3" | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 17 | |
distribution: adopt | |
- name: Reset Dokka | |
run: | | |
cd $GITHUB_WORKSPACE/api/ | |
rm -rf * | |
- name: Generate New Dokka | |
run: | | |
cd $GITHUB_WORKSPACE/Flixclusive/ | |
chmod +x gradlew | |
./gradlew --no-build-cache --no-configuration-cache :dokkaHtmlMultiModule | |
- name: Update Dokka | |
run: | | |
cp -r $GITHUB_WORKSPACE/Flixclusive/build/dokka/htmlMultiModule/* $GITHUB_WORKSPACE/api/ | |
- name: Push builds | |
run: | | |
cd $GITHUB_WORKSPACE/api | |
touch .nojekyll | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Actions" | |
git add . | |
git commit -m "docs(dokka): update API references [flixclusiveorg/Flixclusive@${GITHUB_SHA}]" || exit 0 | |
git push |