Skip to content

Commit feace48

Browse files
committedDec 11, 2024
Refactor Javadoc deployment workflow to separate fetching, building, and committing steps
1 parent fab92eb commit feace48

File tree

1 file changed

+40
-23
lines changed

1 file changed

+40
-23
lines changed
 

Diff for: ‎.github/workflows/build-and-deploy-javadoc.yml

+40-23
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,18 @@
1-
name: Build And Commit Javadoc
1+
name: Update Javadoc
22

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

88
jobs:
9-
build-and-commit-javadoc:
9+
fetch-latest-release:
1010
runs-on: ubuntu-latest
1111

1212
env:
1313
REPO: "processing/processing4"
14-
REMOTE_URL: "https://github.com/processing/processing4.git"
1514

1615
steps:
17-
- name: Checkout gh-pages branch
18-
uses: actions/checkout@v3
19-
with:
20-
ref: gh-pages
21-
22-
- name: Set up JDK 17
23-
uses: actions/setup-java@v3
24-
with:
25-
distribution: 'adopt'
26-
java-version: '17'
27-
28-
- name: Ensure Ant is installed
29-
run: |
30-
if ! command -v ant &> /dev/null; then
31-
echo "Ant not found, installing..."
32-
sudo apt-get update && sudo apt-get install -y ant
33-
else
34-
echo "Ant is already installed"
35-
fi
36-
3716
- name: Get the latest release tag and commit SHA
3817
id: get-commit-sha
3918
run: |
@@ -61,6 +40,34 @@ jobs:
6140
echo "Commit SHA: $commit_sha"
6241
echo "commit_sha=$commit_sha" >> $GITHUB_ENV
6342
43+
build-javadoc:
44+
runs-on: ubuntu-latest
45+
needs: fetch-latest-release
46+
47+
env:
48+
REMOTE_URL: "https://github.com/processing/processing4.git"
49+
50+
steps:
51+
- name: Checkout gh-pages branch
52+
uses: actions/checkout@v3
53+
with:
54+
ref: gh-pages
55+
56+
- name: Set up JDK 17
57+
uses: actions/setup-java@v3
58+
with:
59+
distribution: 'adopt'
60+
java-version: '17'
61+
62+
- name: Ensure Ant is installed
63+
run: |
64+
if ! command -v ant &> /dev/null; then
65+
echo "Ant not found, installing..."
66+
sudo apt-get update && sudo apt-get install -y ant
67+
else
68+
echo "Ant is already installed"
69+
fi
70+
6471
- name: Fetch and checkout the specific commit
6572
run: |
6673
git init processing4
@@ -84,6 +91,16 @@ jobs:
8491
run: |
8592
rm -rf processing4/
8693
94+
commit-javadoc:
95+
runs-on: ubuntu-latest
96+
needs: build-javadoc
97+
98+
steps:
99+
- name: Checkout gh-pages branch
100+
uses: actions/checkout@v3
101+
with:
102+
ref: gh-pages
103+
87104
- name: Commit and Push changes to gh-pages if any changes exist
88105
run: |
89106
git config --global user.name "GitHub Actions"

0 commit comments

Comments
 (0)