actions/cache/restore/action.yaml

21 lines
555 B
YAML
Raw Normal View History

2023-08-07 02:23:39 +00:00
name: Restore Cache
desciption: Restore cached files
inputs:
key:
required: true
type: string
default: default
runs:
using: composite
container:
image: alpine
volumes:
2023-08-07 03:00:51 +00:00
- /mnt/swarm/gitea/runner/cache:/cache
2023-08-07 02:23:39 +00:00
steps:
- run: |
2023-08-07 13:23:39 +00:00
[ ! -f "/cache/$GITHUB_REPOSITORY/${{ inputs.key }}/archive.tar.gz" ] && echo "Cache not found" && exit
2023-08-07 13:34:42 +00:00
tar --overwrite -xzf "/cache/$GITHUB_REPOSITORY/${{ inputs.key }}/archive.tar.gz"
2023-08-07 13:15:21 +00:00
echo "Cache restored: /cache/$GITHUB_REPOSITORY/${{ inputs.key }}/archive.tar.gz"