-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor GitHub Actions workflow to deploy Javadocs without committin…
…g 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.
- Loading branch information
Showing
2 changed files
with
3 additions
and
37 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,10 +48,10 @@ jobs: | |
REMOTE_URL: "https://github.com/processing/processing4.git" | ||
|
||
steps: | ||
- name: Checkout gh-pages branch | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: gh-pages | ||
fetch-depth: 0 | ||
|
||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
|
@@ -79,47 +79,15 @@ jobs: | |
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: Upload Javadocs artifact | ||
uses: actions/upload-pages-artifact@v1 | ||
with: | ||
path: ./docs | ||
path: processing4/build/javadoc/core | ||
|
||
- name: Clean up the processing4 directory | ||
run: | | ||
rm -rf processing4/ | ||
commit-javadoc: | ||
runs-on: ubuntu-latest | ||
needs: build-javadoc | ||
|
||
steps: | ||
- name: Checkout gh-pages branch | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: processing/processing4-javadocs | ||
ref: gh-pages | ||
fetch-depth: 0 | ||
|
||
- name: Commit and Push changes to gh-pages if any changes exist | ||
run: | | ||
git config --global user.name "GitHub Actions" | ||
git config --global user.email "[email protected]" | ||
if [ -n "$(git status --porcelain docs/)" ]; then | ||
git add docs/ | ||
git commit -m "Update Javadocs" | ||
git push https://[email protected]/processing/processing4-javadocs.git HEAD:gh-pages | ||
else | ||
echo "No changes to commit." | ||
fi | ||
env: | ||
PAT_TOKEN: ${{ secrets.PAT_TOKEN }} | ||
|
||
deploy-javadoc: | ||
needs: build-javadoc | ||
permissions: | ||
|
This file contains 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