Skip to content

Commit

Permalink
Refactor Javadoc deployment workflow to separate fetching, building, …
Browse files Browse the repository at this point in the history
…and committing steps
  • Loading branch information
SableRaf committed Dec 11, 2024
1 parent fab92eb commit feace48
Showing 1 changed file with 40 additions and 23 deletions.
63 changes: 40 additions & 23 deletions .github/workflows/build-and-deploy-javadoc.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,18 @@
name: Build And Commit Javadoc
name: Update Javadoc

on:
schedule:
- cron: '0 0 * * 1' # This runs the workflow every Monday at midnight UTC
workflow_dispatch:

jobs:
build-and-commit-javadoc:
fetch-latest-release:
runs-on: ubuntu-latest

env:
REPO: "processing/processing4"
REMOTE_URL: "https://github.com/processing/processing4.git"

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: |
if ! command -v ant &> /dev/null; then
echo "Ant not found, installing..."
sudo apt-get update && sudo apt-get install -y ant
else
echo "Ant is already installed"
fi
- name: Get the latest release tag and commit SHA
id: get-commit-sha
run: |
Expand Down Expand Up @@ -61,6 +40,34 @@ jobs:
echo "Commit SHA: $commit_sha"
echo "commit_sha=$commit_sha" >> $GITHUB_ENV
build-javadoc:
runs-on: ubuntu-latest
needs: fetch-latest-release

env:
REMOTE_URL: "https://github.com/processing/processing4.git"

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: |
if ! command -v ant &> /dev/null; then
echo "Ant not found, installing..."
sudo apt-get update && sudo apt-get install -y ant
else
echo "Ant is already installed"
fi
- name: Fetch and checkout the specific commit
run: |
git init processing4
Expand All @@ -84,6 +91,16 @@ jobs:
run: |
rm -rf processing4/
commit-javadoc:
runs-on: ubuntu-latest
needs: build-javadoc

steps:
- name: Checkout gh-pages branch
uses: actions/checkout@v3
with:
ref: gh-pages

- name: Commit and Push changes to gh-pages if any changes exist
run: |
git config --global user.name "GitHub Actions"
Expand Down

0 comments on commit feace48

Please sign in to comment.