mirror of
https://code.forgejo.org/actions/cache.git
synced 2024-11-16 23:51:16 +01:00
Add flexible R env example
Use variables to specify location
This commit is contained in:
parent
3a696372f2
commit
21a5693e30
1 changed files with 15 additions and 2 deletions
17
examples.md
17
examples.md
|
@ -412,7 +412,20 @@ Locations:
|
||||||
- macOS: `~/Library/Application Support/renv`
|
- macOS: `~/Library/Application Support/renv`
|
||||||
- Windows: `%LOCALAPPDATA%/renv`
|
- Windows: `%LOCALAPPDATA%/renv`
|
||||||
|
|
||||||
### Simple example
|
|
||||||
|
### Using variables to specify location
|
||||||
|
|
||||||
|
(Appropriate for single or multiple operating systems.)
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ${{ env.R_LIBS_USER }}
|
||||||
|
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
|
||||||
|
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
|
||||||
|
```
|
||||||
|
|
||||||
|
### Simple example with hard-coded path
|
||||||
```yaml
|
```yaml
|
||||||
- uses: actions/cache@v2
|
- uses: actions/cache@v2
|
||||||
with:
|
with:
|
||||||
|
@ -424,7 +437,7 @@ Locations:
|
||||||
|
|
||||||
Replace `~/.local/share/renv` with the correct `path` if not using Ubuntu.
|
Replace `~/.local/share/renv` with the correct `path` if not using Ubuntu.
|
||||||
|
|
||||||
### Multiple OS's in a workflow
|
### Multiple OSs in a workflow
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- uses: actions/cache@v2
|
- uses: actions/cache@v2
|
||||||
|
|
Loading…
Reference in a new issue