Skip to content

Create a GH workflow to cleanup the GH cache - #6080

Merged
christyjacob4 merged 1 commit into
masterfrom
feat-github-cache
Aug 31, 2023
Merged

christyjacob4 merged 1 commit into
masterfrom
feat-github-cache

Conversation

@stnguyen90

@stnguyen90 stnguyen90 commented Aug 30, 2023 •

Copy link
Copy Markdown
Contributor

What does this PR do?

The GitHub actions cache is helpful to speed up CI jobs. Once a branch is closed, we don't need the cacche anymore so we should delete it so the disk space can be reclaimed.

This workflow was copied from https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#force-deleting-cache-entries.

Test Plan

https://github.com/appwrite/appwrite/actions/runs/6031274668/job/16364664657?pr=6080

Related PRs and Issues

None

Checklist

  • Have you read the Contributing Guidelines on issues?
  • If the PR includes a change to an API's metadata (desc, label, params, etc.), does it also include updated API specs and example docs?

@stnguyen90
stnguyen90 marked this pull request as ready for review August 30, 2023 22:41
Comment thread .github/workflows/cleanup-cache.yml Outdated
BRANCH="refs/pull/${{ github.event.pull_request.number }}/merge"

echo "Fetching list of cache key"
cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH -L 100 | cut -f 1 )

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think if we remove -L 100 it will clear the entire cache instead of only the oldest 100

@stnguyen90 stnguyen90 Aug 30, 2023 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Default limit is 30. Max limit is 100: https://github.com/actions/gh-actions-cache#list

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we paginate and delete them all?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

The GitHub actions cache is helpful to speed up CI jobs. Once a branch
is closed, we don't need the cacche anymore so we should delete it so
the disk space can be reclaimed.

This workflow was copied from https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#force-deleting-cache-entries.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants