Skip to content

Commit

Permalink
use consistent COMMIT_SHA variable for Javadoc build and caching
Browse files Browse the repository at this point in the history
  • Loading branch information
SableRaf committed Dec 11, 2024
1 parent 91e4548 commit 59e755e
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/build-and-deploy-javadoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ jobs:
env:
REPO: "processing/processing4"

outputs:
commit_sha: ${{ steps.get-commit-sha.outputs.commit_sha }}

steps:
- name: Get the latest release tag and commit SHA
id: get-commit-sha
Expand Down Expand Up @@ -39,13 +42,15 @@ jobs:
echo "Commit SHA: $commit_sha"
echo "commit_sha=$commit_sha" >> $GITHUB_ENV
echo "commit_sha=$commit_sha" >> $GITHUB_OUTPUT
build-javadoc:
runs-on: ubuntu-latest
needs: fetch-latest-release

env:
REMOTE_URL: "https://github.com/processing/processing4.git"
COMMIT_SHA: ${{ needs.fetch-latest-release.outputs.commit_sha }}

steps:
- name: Checkout repository
Expand All @@ -72,7 +77,7 @@ jobs:
run: |
git clone ${{ env.REMOTE_URL }} processing4
cd processing4
git checkout ${{ env.commit_sha }}
git checkout ${{ env.COMMIT_SHA }}
- name: Generate Javadocs
working-directory: processing4/build
Expand All @@ -86,7 +91,7 @@ jobs:
uses: actions/cache@v4
with:
path: processing4/build/javadoc
key: javadocs-${{ env.commit_sha }}
key: javadocs-${{ env.COMMIT_SHA }}
restore-keys: |
javadocs-
Expand Down Expand Up @@ -116,6 +121,8 @@ jobs:
commit-javadoc:
needs: build-javadoc
runs-on: ubuntu-latest
env:
COMMIT_SHA: ${{ needs.fetch-latest-release.outputs.commit_sha }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
Expand All @@ -125,8 +132,8 @@ jobs:
- name: Restore Javadocs from cache
uses: actions/cache@v4
with:
path: doc
key: javadocs-${{ env.commit_sha }}
path: processing4/build/javadoc
key: javadocs-${{ env.COMMIT_SHA }}
restore-keys: |
javadocs-
Expand Down

0 comments on commit 59e755e

Please sign in to comment.