From c079aa0dc7019fb2cc0cedd400ef8393d910d029 Mon Sep 17 00:00:00 2001 From: Austin Shalit Date: Tue, 8 Sep 2020 00:09:59 -0400 Subject: [PATCH] Publish javadocs with GitHub Actions (#968) --- .azure-scripts/push-javadoc-to-gh-pages.sh | 29 ---------------------- .github/workflows/deploy-javadoc.yml | 28 +++++++++++++++++++++ 2 files changed, 28 insertions(+), 29 deletions(-) delete mode 100755 .azure-scripts/push-javadoc-to-gh-pages.sh create mode 100644 .github/workflows/deploy-javadoc.yml diff --git a/.azure-scripts/push-javadoc-to-gh-pages.sh b/.azure-scripts/push-javadoc-to-gh-pages.sh deleted file mode 100755 index ed26474036..0000000000 --- a/.azure-scripts/push-javadoc-to-gh-pages.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash - -# Source of file: http://benlimmer.com/2013/12/26/automatically-publish-javadoc-to-gh-pages-with-travis-ci/ - -if [ -z ${GH_TOKEN+x} ]; then - echo "GH_TOKEN is unset, cannot publish Javadoc" - exit 0; -fi - -echo -e "Generating javadoc...\n" -./gradlew aggregateJavadocs - -echo -e "Publishing javadoc...\n" - -cp -R build/docs/javadoc $HOME/javadoc-latest - -cd $HOME -git config --global user.email "azuredevops@microsoft.com" -git config --global user.name "azure-pipelines" -git clone --quiet --branch=gh-pages https://${GH_TOKEN}@github.com/WPIRoboticsProjects/grip gh-pages #> /dev/null - -cd gh-pages -git rm -rf ./javadoc -cp -Rf $HOME/javadoc-latest ./javadoc -git add -f . -git commit -m "Lastest javadoc on successful Azure build ${BUILD_BUILDNUMBER} auto-pushed to gh-pages" -git push -fq origin gh-pages #> /dev/null - -echo -e "Published Javadoc to gh-pages.\n" diff --git a/.github/workflows/deploy-javadoc.yml b/.github/workflows/deploy-javadoc.yml new file mode 100644 index 0000000000..07d81805a4 --- /dev/null +++ b/.github/workflows/deploy-javadoc.yml @@ -0,0 +1,28 @@ +name: Deploy Javadoc + +on: + push: + branches: + - master + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - uses: actions/setup-java@v1 + with: + java-version: 11 + java-package: jdk+fx + - name: Generate Javadoc + run: ./gradlew aggregateJavadocs + - name: Deploy 🚀 + uses: JamesIves/github-pages-deploy-action@3.5.9 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + BRANCH: gh-pages + CLEAN: true + FOLDER: build/docs/javadoc + TARGET_FOLDER: javadoc