Skip to content

Commit

Permalink
Check if cache exists
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielKotik committed Feb 27, 2022
1 parent d1d3d32 commit 1a2c7e7
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion .github/workflows/new.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,15 @@ jobs:
echo "IMAGE_REPO=$IMAGE_REPO" >> $GITHUB_ENV
echo "IMAGE_REPO=$IMAGE_REPO"
- name: Check if cache exists cache
uses: actions/cache@v2
id: cache-docker
with:
path: ${{ env.DOCKER_ARTIFACT_PATH }}
key: ${{ github.run_id }}

- name: Pull latest image from container registry
if: steps.cache-docker.outputs.cache-hit != 'true'
run: docker pull $IMAGE_REPO/$IMAGE_NAME || true

- name: Build temporary image
Expand Down Expand Up @@ -73,7 +81,7 @@ jobs:
# Save Docker image locally
docker save $IMAGE_NAME:$GITHUB_RUN_ID -o $DOCKER_ARTIFACT_PATH/docker-image.tar
#pigz --fast $DOCKER_ARTIFACT_PATH/docker-image.tar
pigz --fast $DOCKER_ARTIFACT_PATH/docker-image.tar
fi
- name: Upload saved Docker image to artifact cache
Expand Down

0 comments on commit 1a2c7e7

Please sign in to comment.