get-docker-image:
steps:
- name: Create cache for docker image
uses: actions/cache@v4
with:
path: images
key: image-key
- name: Download docker image from source
run: |
mkdir -p images
cd images
docker login registry
docker pull path/image:tag
docker save path/image:tag | gzip > docker-image.tgz
user-docker-image:
needs:
- get-docker-image
steps:
- name: Restore cached docker image
uses: actions/cache/restore@v4
with:
path: images
key: image-key
- name: Use the image
working-directory: images
run: |
docker load < docker-image.tgz
// do something with the image
Refs §
- https://stackoverflow.com/questions/57498605/github-actions-share-workspace-artifacts-between-jobs