Update Javadoc #1
This file contains hidden or 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: Build and Deploy Javadoc | |
on: | |
schedule: | |
- cron: '0 0 * * 1' # This runs the workflow every Monday at midnight UTC | |
workflow_dispatch: | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout gh-pages branch | |
uses: actions/checkout@v3 | |
with: | |
ref: gh-pages | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'adopt' | |
java-version: '17' | |
- name: Ensure Ant is installed | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y ant | |
- name: Clone the processing4 repository | |
run: | | |
git clone --depth 1 https://github.com/processing/processing4.git | |
- name: Generate Javadoc | |
working-directory: processing4/build | |
run: | | |
ant doc | |
- name: Copy Javadoc to /docs directory | |
run: | | |
if [ -d "processing4/build/javadoc/core" ]; then | |
cp -r processing4/build/javadoc/core docs/ | |
fi | |
- name: Commit and Push changes to gh-pages | |
run: | | |
git config --global user.name "GitHub Actions" | |
git config --global user.email "actions@github.com" | |
git add docs/ | |
git commit -m "Update Javadocs" | |
git push https://$PAT_TOKEN@github.com/processing/processing4-javadocs.git HEAD:gh-pages | |
env: | |
PAT_TOKEN: ${{ secrets.PAT_TOKEN }} |