Improved tests #7
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 and Publish Javadoc | |
on: | |
push: | |
branches: | |
- master | |
permissions: | |
checks: write | |
actions: read | |
contents: write | |
jobs: | |
build: | |
# Only generate JavaDoc for the main repository | |
if: github.repository_owner == 'ohjelmointi2' | |
name: Javadoc | |
runs-on: ubuntu-latest | |
steps: | |
# Checkout the repository | |
- uses: actions/checkout@v4 | |
# Install Java 17. See https://github.com/education/autograding/issues/18 | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
- name: Build and Generate Javadoc | |
run: ./gradlew javadoc | |
- name: Publish Javadoc | |
run: | | |
git config --local user.email "actions@github.com" | |
git config --local user.name "GitHub Actions" | |
mv build/docs/javadoc docs | |
git add docs | |
git commit -m "Publish Javadoc" | |
git push origin master:gh-pages --force | |
- name: Cleanup | |
run: | | |
rm -rf docs |