|
41 | 41 | REGISTRY: ghcr.io |
42 | 42 | IMAGE_NAME: ${{ github.repository }} |
43 | 43 | ARTIFACTORY_REPOSITORY_SNAPSHOT: ionos-productivity-ncwserver-snapshot |
| 44 | + # Cache version - increment this to invalidate all caches when build process changes |
| 45 | + # Update when: Node.js version changes, PHP version changes, build scripts modified, etc. |
| 46 | + # Format: v<major>.<minor> (e.g., v1.0, v1.1, v2.0) |
| 47 | + CACHE_VERSION: v1.0 |
44 | 48 |
|
45 | 49 | permissions: |
46 | 50 | contents: read |
@@ -569,7 +573,8 @@ jobs: |
569 | 573 | fi |
570 | 574 |
|
571 | 575 | # Cache key that would be used for this app |
572 | | - CACHE_KEY="app-build-${APP_NAME}-${CURRENT_SHA}" |
| 576 | + # Format: <version>-app-build-<app-name>-<sha> |
| 577 | + CACHE_KEY="${{ env.CACHE_VERSION }}-app-build-${APP_NAME}-${CURRENT_SHA}" |
573 | 578 | SHORT_SHA="${CURRENT_SHA:0:8}" |
574 | 579 |
|
575 | 580 | echo -n " Checking $APP_NAME (SHA: $SHORT_SHA)... " |
@@ -731,7 +736,7 @@ jobs: |
731 | 736 | uses: actions/cache/save@v4 |
732 | 737 | with: |
733 | 738 | path: ${{ steps.app-config.outputs.path }} |
734 | | - key: app-build-${{ matrix.app_info.name }}-${{ matrix.app_info.sha }} |
| 739 | + key: ${{ env.CACHE_VERSION }}-app-build-${{ matrix.app_info.name }}-${{ matrix.app_info.sha }} |
735 | 740 |
|
736 | 741 | - name: Upload ${{ matrix.app_info.name }} build artifacts |
737 | 742 | uses: actions/upload-artifact@v4 |
@@ -797,7 +802,7 @@ jobs: |
797 | 802 | uses: actions/cache/restore@v4 |
798 | 803 | with: |
799 | 804 | path: ${{ matrix.app.path }} |
800 | | - key: app-build-${{ matrix.app.name }}-${{ steps.get-sha.outputs.app-sha }} |
| 805 | + key: ${{ env.CACHE_VERSION }}-app-build-${{ matrix.app.name }}-${{ steps.get-sha.outputs.app-sha }} |
801 | 806 | fail-on-cache-miss: true |
802 | 807 |
|
803 | 808 | - name: Validate cached build |
|
0 commit comments