Skip to content

Commit 91e4548

Browse files
committed
Add caching for Javadocs in GitHub Actions workflow
1 parent 7b26668 commit 91e4548

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

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

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,13 @@ jobs:
8282
- name: Add .nojekyll file
8383
run: echo > processing4/build/javadoc/.nojekyll
8484

85-
- name: Upload Javadocs artifact
86-
uses: actions/upload-pages-artifact@v3
85+
- name: Cache Javadocs
86+
uses: actions/cache@v4
8787
with:
88-
name: github-pages
8988
path: processing4/build/javadoc
89+
key: javadocs-${{ env.commit_sha }}
90+
restore-keys: |
91+
javadocs-
9092
9193
- name: Clean up the processing4 directory
9294
run: |
@@ -120,10 +122,21 @@ jobs:
120122
with:
121123
fetch-depth: 0
122124

123-
- name: Copy Javadocs to /doc folder
125+
- name: Restore Javadocs from cache
126+
uses: actions/cache@v4
127+
with:
128+
path: doc
129+
key: javadocs-${{ env.commit_sha }}
130+
restore-keys: |
131+
javadocs-
132+
133+
- name: Configure Git
124134
run: |
125135
git config --global user.name "github-actions[bot]"
126136
git config --global user.email "github-actions[bot]@users.noreply.github.com"
137+
138+
- name: Copy Javadocs to /doc folder
139+
run: |
127140
mkdir -p doc
128141
cp -r processing4/build/javadoc/* doc/
129142
git add doc/
@@ -132,4 +145,3 @@ jobs:
132145
else
133146
git commit -m "Update Javadocs"
134147
git push
135-
fi

0 commit comments

Comments
 (0)