Skip to content

Commit 90df74e

Browse files
committed
Refactor GitHub Actions workflow to deploy Javadocs without committing to the repository
- Removed the `commit-javadoc` job to prevent committing files to the repository. - Updated the `build-javadoc` job to upload Javadocs as artifacts. - Modified the `deploy-javadoc` job to deploy using the uploaded artifacts. - Updated README to reflect the new deployment process.
1 parent d7f1d65 commit 90df74e

File tree

2 files changed

+3
-37
lines changed

2 files changed

+3
-37
lines changed

.github/workflows/build-and-deploy-javadoc.yml

Lines changed: 3 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ jobs:
4848
REMOTE_URL: "https://github.com/processing/processing4.git"
4949

5050
steps:
51-
- name: Checkout gh-pages branch
51+
- name: Checkout repository
5252
uses: actions/checkout@v3
5353
with:
54-
ref: gh-pages
54+
fetch-depth: 0
5555

5656
- name: Set up JDK 17
5757
uses: actions/setup-java@v3
@@ -79,47 +79,15 @@ jobs:
7979
run: |
8080
ant doc
8181
82-
- name: Copy Javadoc to /docs directory
83-
run: |
84-
if [ -d "processing4/build/javadoc/core" ]; then
85-
cp -r processing4/build/javadoc/core ../docs/
86-
fi
87-
8882
- name: Upload Javadocs artifact
8983
uses: actions/upload-pages-artifact@v1
9084
with:
91-
path: ./docs
85+
path: processing4/build/javadoc/core
9286

9387
- name: Clean up the processing4 directory
9488
run: |
9589
rm -rf processing4/
9690
97-
commit-javadoc:
98-
runs-on: ubuntu-latest
99-
needs: build-javadoc
100-
101-
steps:
102-
- name: Checkout gh-pages branch
103-
uses: actions/checkout@v3
104-
with:
105-
repository: processing/processing4-javadocs
106-
ref: gh-pages
107-
fetch-depth: 0
108-
109-
- name: Commit and Push changes to gh-pages if any changes exist
110-
run: |
111-
git config --global user.name "GitHub Actions"
112-
git config --global user.email "actions@github.com"
113-
if [ -n "$(git status --porcelain docs/)" ]; then
114-
git add docs/
115-
git commit -m "Update Javadocs"
116-
git push https://$PAT_TOKEN@github.com/processing/processing4-javadocs.git HEAD:gh-pages
117-
else
118-
echo "No changes to commit."
119-
fi
120-
env:
121-
PAT_TOKEN: ${{ secrets.PAT_TOKEN }}
122-
12391
deploy-javadoc:
12492
needs: build-javadoc
12593
permissions:

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ This repository uses a custom GitHub Actions workflow [`build-and-deploy-javadoc
99

1010
The workflow clones the `processing/processing4` repository, gets the commit corresponding to the latest release, builds the Javadocs using `ant`, and copies the generated files to the `/docs` directory of this repository. The updated Javadocs are then committed and pushed to the `gh-pages` branch.
1111

12-
We've set "Deploy from branch" in the repo settings to trigger on push to the `gh-pages` branch. Every time the `build-and-deploy-javadoc.yml` workflow completes, it will trigger a deploy to GitHub pages.
13-
1412
The workflow is triggered every Monday at midnight (UTC). A maintainer can manually trigger the workflow if needed.
1513

1614
## Legacy

0 commit comments

Comments
 (0)