Quantcast
Channel: Clear cache in GitHub Actions - Stack Overflow
Viewing all articles
Browse latest Browse all 12

Answer by Andrii Bodnar for Clear cache in GitHub Actions

$
0
0

One more easy and straightforward way to remove Actions' cache - Purge cache GH Action.

This action allows the cache of GitHub Actions to be automatically purged based on the last usage and configured TTL (default - 7 days).

Example:

name: Clear Cacheon:  schedule:    - cron: '0 0 * * *' # Runs once a day (https://crontab.guru/once-a-day)jobs:  clear:    name: Clear cache    runs-on: ubuntu-latest    steps:    - uses: MyAlbum/purge-cache@v1      with:      max-age: 604800 # Cache max 7 days since last use (this is the default)

The workflow above will run once a day and remove all the cache that was last used more than 7 days ago.


Viewing all articles
Browse latest Browse all 12

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>