Update generate_dokka.yml

This commit is contained in:
Cloudburst 2022-08-15 12:27:22 +02:00 committed by GitHub
parent 6b011ac0ad
commit ec97feabad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 18 additions and 8 deletions

View File

@ -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