Update renovate.json #22
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: Dokka for Github Pages | |
# This workflow will: | |
# 1. Trigger on a push to the `main` branch. | |
# 2. Check out the repository. | |
# 3. Set up JDK 19. | |
# 4. Build the project using Gradle. | |
# 5. Generate Dokka HTML documentation. | |
# 6. Move the generated documentation to the `/docs` directory. | |
# 7. Commit and push the changes to the `main` branch, updating GitHub Pages. | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
dokka: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write # Ensure the token has write permissions to the repository | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up JDK 19 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '19' | |
# Configure Gradle for optimal use in GiHub Actions, including caching of downloaded dependencies. | |
# See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v4 | |
- name: Grant execute permission for gradlew | |
run: chmod +x ./gradlew | |
- name: Generate Dokka HTML | |
run: ./gradlew :lib:dokkaHtml | |
# Move Dokka HTML files to the /docs folder | |
- name: Move Dokka HTML to /docs | |
run: | | |
rm -rf docs/* | |
mv lib/build/dokka/html/* docs/ | |
# Commit and push changes to the /docs folder | |
- name: Commit and push changes | |
run: | | |
git config --local user.name "GitHub Actions [bot]" | |
git config --local user.email "actions@users.noreply.github.com" | |
git add docs/ | |
# Check if there are any changes staged | |
if ! git diff --cached --exit-code >/dev/null; then | |
git commit -m "Update Dokka HTML documentation" | |
git push origin main | |
else | |
echo "No changes to commit." | |
fi | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |