mirror of
https://github.com/gradle/gradle-build-action.git
synced 2024-11-22 08:11:07 -05:00
Document using secret for encryption key
This commit is contained in:
parent
3f2ca32cb0
commit
ceb0c736c1
1 changed files with 4 additions and 3 deletions
|
@ -167,9 +167,10 @@ in the project directory, at `<project-dir>/.gradle/configuration-cache`. Due to
|
|||
secrets](https://docs.gradle.org/release-nightly/userguide/configuration_cache.html#config_cache:secrets), and this data needs to be encrypted in order to be safely stored in the GitHub Actions cache.
|
||||
|
||||
In order to benefit from configuration caching in your GitHub Actions workflow, you must:
|
||||
- Enable the configuration cache for your build
|
||||
- Execute your build with Gradle 8.6 or newer. This can be achieved directly, or via the Gradle Wrapper.
|
||||
- Provide a [valid Gradle encryption key](https://docs.gradle.org/release-nightly/userguide/configuration_cache.html#config_cache:secrets:configuring_encryption_key) via the `cache-encryption-key` action parameter
|
||||
- Enable the configuration cache for your build.
|
||||
- Generate a [valid Gradle encryption key](https://docs.gradle.org/release-nightly/userguide/configuration_cache.html#config_cache:secrets:configuring_encryption_key) and save it as a [GitHub Actions secret](https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions).
|
||||
- Provide the secret key via the `cache-encryption-key` action parameter.
|
||||
|
||||
```yaml
|
||||
jobs:
|
||||
|
@ -180,7 +181,7 @@ jobs:
|
|||
- uses: gradle/gradle-build-action@v3
|
||||
with:
|
||||
gradle-version: 8.6
|
||||
cache-encryption-key: Da25KUVSE5jbGds2zXmfXw==
|
||||
cache-encryption-key: ${{ secrets.GradleEncryptionKey }}
|
||||
- run: gradle build --configuration-cache
|
||||
```
|
||||
|
||||
|
|
Loading…
Reference in a new issue