{"id":24475582,"url":"https://github.com/byk/docker-volume-cache-action","last_synced_at":"2026-01-02T05:31:16.010Z","repository":{"id":272081027,"uuid":"915464991","full_name":"BYK/docker-volume-cache-action","owner":"BYK","description":"A GitHub Action to cache and restore Docker Volumes","archived":false,"fork":false,"pushed_at":"2025-01-14T22:57:35.000Z","size":29,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-21T09:15:30.569Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BYK.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-11T22:56:46.000Z","updated_at":"2025-01-14T23:05:41.000Z","dependencies_parsed_at":"2025-01-12T00:22:27.162Z","dependency_job_id":"f882dea5-91fe-4fb8-88ed-693ea1161379","html_url":"https://github.com/BYK/docker-volume-cache-action","commit_stats":null,"previous_names":["byk/docker-volume-cache-action"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BYK%2Fdocker-volume-cache-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BYK%2Fdocker-volume-cache-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BYK%2Fdocker-volume-cache-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BYK%2Fdocker-volume-cache-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BYK","download_url":"https://codeload.github.com/BYK/docker-volume-cache-action/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243603240,"owners_count":20317799,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-21T09:15:32.419Z","updated_at":"2026-01-02T05:31:15.971Z","avatar_url":"https://github.com/BYK.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# docker-volume-cache-action\n\nA GitHub Action to cache and restore Docker Volumes\n\n## Why?\n\nIt is notoriously tricky to cache Docker volume data, especially with GitHub's\nnative [actions/cache](https://github.com/actions/cache/) action. This combined\naction provides a `BYK/docker-volume-cache-action/save` and `BYK/docker-volume-cache-action/restore`\nrespectively for making this easy and painless.\n\nIf you have the time, you can read https://byk.im/posts/docker-volume-caching-gha/\n\n## Usage\n\n```yaml\nname: Test\non:\n  push:\n    branches:\n      - \"main\"\n  pull_request:\n\ndefaults:\n  run:\n    shell: bash\njobs:\n  test:\n    steps:\n      - name: Checkout latest release\n        uses: actions/checkout@v4\n\n      - name: Compute Docker Volume Cache Key\n        id: cache_key\n        run: |\n          MY_IMAGE_MD5=$(docker run --rm --entrypoint bash MY_DOCKER_IMAGE -c 'ls -Rv1rpq some/directory' | md5sum | cut -d ' ' -f 1)\n          echo \"MY_IMAGE_MD5=$MY_IMAGE_MD5\" \u003e\u003e $GITHUB_OUTPUT\n\n      - name: Restore DB Volumes Cache\n        id: restore_cache\n        uses: BYK/docker-volume-cache-action/restore@main\n        with:\n          key: docker-volumes-v1-${{ steps.cache_key.outputs.MY_IMAGE_MD5 }}\n          restore-keys: |\n            docker-volumes-v1-\n          volumes: |\n            volume-name-1\n            volume-name-2\n\n      - name: Long test using volumes\n        if: steps.restore_cache.outputs.cache-hit != 'true'\n        run: |\n          ./run_tests.sh\n\n      - name: Save DB Volumes Cache\n        if: steps.restore_cache.outputs.cache-hit != 'true'\n        uses: BYK/docker-volume-cache-action/save@main\n        with:\n          key: ${{ steps.restore_cache.outputs.cache-primary-key }}\n          volumes: |\n            volume-name-1\n            volume-name-2\n```\n\n## Documentation\n\n### Restore action\n\nBYK/docker-volume-cache-action/restore\n\n#### Inputs\n\n* `key` - An explicit key for a cache entry.\n* `volumes` - A list of Docker volume names to restore\n* `restore-keys` - An ordered list of prefix-matched keys to use for restoring stale cache if no cache hit occurred for key.\n* `fail-on-cache-miss` - Fail the workflow if cache entry is not found. Default: `false`\n\n### Outputs\n\n* `cache-hit` - A boolean value to indicate an exact match was found for the key.\n* `cache-primary-key` - Cache primary key passed in the input to use in subsequent steps of the workflow.\n* `cache-matched-key` - Key of the cache that was restored, it could either be the primary key on cache-hit or a partial/complete match of one of the restore keys.\n\n\u003e **Note**\n`cache-hit` will be set to `true` only when cache hit occurs for the exact `key` match. For a partial key match via `restore-keys` or a cache miss, it will be set to `false`.\n\n### Save action\n\nBYK/docker-volume-cache-action/save\n\n#### Inputs\n\n* `key` - An explicit key for a cache entry.\n* `volumes` - A list of Docker volume names to cache\n* `upload-chunk-size` - The chunk size used to split up large files during upload, in bytes\n\n#### Outputs\n\nThis action has no outputs.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbyk%2Fdocker-volume-cache-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbyk%2Fdocker-volume-cache-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbyk%2Fdocker-volume-cache-action/lists"}