Skip to content
This repository has been archived by the owner on Aug 5, 2024. It is now read-only.

Commit

Permalink
Create javadoc.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
swd1tn002 committed Oct 23, 2023
1 parent b9cf11a commit 2f38aa4
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/javadoc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
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

0 comments on commit 2f38aa4

Please sign in to comment.