Document use of upload-artifact to save build outputs

This commit is contained in:
Daz DeBoer 2022-04-04 15:07:16 -06:00 committed by GitHub
parent f78055c629
commit ff8a687227
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -288,6 +288,32 @@ Each build is different, and some builds produce more Gradle User Home content t
[Cache debugging ](#cache-debugging-and-analysis) can provide insight into which cache entries are the largest, [Cache debugging ](#cache-debugging-and-analysis) can provide insight into which cache entries are the largest,
and you can selectively [exclude content using `gradle-home-cache-exclude`](#gradle-user-home-cache-tuning). and you can selectively [exclude content using `gradle-home-cache-exclude`](#gradle-user-home-cache-tuning).
## Saving build outputs
By default, a GitHub Actions workflow using `gradle-build-action` will record the log output and any Build Scan links for your build,
but any output files generated by the build will not be saved.
To save selected files from your build execution, you can use the core [Upload-Artifact](https://github.com/actions/upload-artifact) action.
For example:
```
jobs:
gradle:
runs-on: ubuntu-latest
steps:
- name: Checkout project sources
uses: actions/checkout@v2
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Run build with Gradle wrapper
run: ./gradlew build --scan
- name: Upload build reports
uses: actions/upload-artifact@v3
with:
name: build-reports
path: build/reports/
```
## Build scans ## Build scans
If your build publishes a [build scan](https://gradle.com/build-scans/) the `gradle-build-action` action will: If your build publishes a [build scan](https://gradle.com/build-scans/) the `gradle-build-action` action will: