diff --git a/.github/workflows/generate_dokka.yml b/.github/workflows/generate_dokka.yml index 7b3299e4..38fe024b 100644 --- a/.github/workflows/generate_dokka.yml +++ b/.github/workflows/generate_dokka.yml @@ -18,6 +18,13 @@ jobs: build: runs-on: ubuntu-latest steps: + - name: Generate access token + id: generate_token + uses: tibdex/github-app-token@v1 + with: + app_id: ${{ secrets.GH_APP_ID }} + private_key: ${{ secrets.GH_APP_KEY }} + repository: "recloudstream/dokka" - name: Checkout uses: actions/checkout@master with: @@ -26,11 +33,15 @@ jobs: - name: Checkout dokka uses: actions/checkout@master with: - ref: "dokka" + repository: "recloudstream/dokka" path: "dokka" + token: ${{ steps.generate_token.outputs.token }} - name: Clean old builds - run: rm -rf $GITHUB_WORKSPACE/dokka/html/* + run: | + shopt -s extglob + cd $GITHUB_WORKSPACE/dokka/ + rm -rf !(.git) - name: Setup JDK 11 uses: actions/setup-java@v1 @@ -42,20 +53,19 @@ jobs: - name: Generate Dokka run: | - cd src + cd $GITHUB_WORKSPACE/src/ chmod +x gradlew ./gradlew app:dokkaHtml - cd .. - name: Copy Dokka run: | - cp -r src/app/build/dokka/html $GITHUB_WORKSPACE/dokka/ + cp -r $GITHUB_WORKSPACE/src/app/build/dokka/html/* $GITHUB_WORKSPACE/dokka/ - name: Push builds run: | cd $GITHUB_WORKSPACE/dokka - git config --local user.email "actions@github.com" - git config --local user.name "GitHub Actions" + git config --local user.email "110591699+recloudstream@users.noreply.github.com" + git config --local user.name "recloudstream" git add . - git commit --amend -m "Generate dokka for $GITHUB_SHA" || exit 0 # do not error if nothing to commit + git commit --amend -m "Generate dokka for recloudstream/cloudstream@${GITHUB_SHA}" || exit 0 # do not error if nothing to commit git push --force