feat(ci): Improve cache hits
This commit is contained in:
committed by
Carlos Álvaro
parent
c556e06e55
commit
4b5ebaa95a
15
.github/workflows/build-and-test.yml
vendored
15
.github/workflows/build-and-test.yml
vendored
@@ -15,7 +15,7 @@ on:
|
|||||||
env:
|
env:
|
||||||
IMAGE_NAME: localhost:5000/cdalvaro/docker-salt-master:${{ github.sha }}
|
IMAGE_NAME: localhost:5000/cdalvaro/docker-salt-master:${{ github.sha }}
|
||||||
REGISTRY_PATH: ${{ github.workspace }}/registry
|
REGISTRY_PATH: ${{ github.workspace }}/registry
|
||||||
CACHE_PATH: /tmp/.buildx-cache
|
CACHE_PATH: ${{ github.workspace }}/.buildx-cache
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@@ -40,6 +40,7 @@ jobs:
|
|||||||
--name registry registry:2
|
--name registry registry:2
|
||||||
|
|
||||||
- name: Cache Docker layers
|
- name: Cache Docker layers
|
||||||
|
id: cache-docker-layers
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: ${{ env.CACHE_PATH }}
|
path: ${{ env.CACHE_PATH }}
|
||||||
@@ -47,6 +48,17 @@ jobs:
|
|||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-buildx-
|
${{ runner.os }}-buildx-
|
||||||
|
|
||||||
|
- name: Cache hit
|
||||||
|
continue-on-error: true
|
||||||
|
env:
|
||||||
|
CACHE_HIT: ${{ steps.cache-docker-layers.outputs.cache-hit }}
|
||||||
|
run: |
|
||||||
|
if [[ "${CACHE_HIT}" != 'true' ]]; then
|
||||||
|
echo "No cache hit" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "Cache contents available at: ${CACHE_PATH}"
|
||||||
|
|
||||||
- name: Build docker-salt-master image
|
- name: Build docker-salt-master image
|
||||||
uses: docker/build-push-action@v3.2.0
|
uses: docker/build-push-action@v3.2.0
|
||||||
with:
|
with:
|
||||||
@@ -57,6 +69,7 @@ jobs:
|
|||||||
type=local,src=${{ env.CACHE_PATH }}
|
type=local,src=${{ env.CACHE_PATH }}
|
||||||
ghcr.io/cdalvaro/docker-salt-master:latest
|
ghcr.io/cdalvaro/docker-salt-master:latest
|
||||||
cache-to: type=local,dest=${{ env.CACHE_PATH }}
|
cache-to: type=local,dest=${{ env.CACHE_PATH }}
|
||||||
|
pull: true
|
||||||
push: true
|
push: true
|
||||||
tags: ${{ env.IMAGE_NAME }}
|
tags: ${{ env.IMAGE_NAME }}
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,10 @@ This file only reflects the changes that are made in this image.
|
|||||||
Please refer to the [Salt 3005.1 Release Notes](https://docs.saltstack.com/en/latest/topics/releases/3005.1.html)
|
Please refer to the [Salt 3005.1 Release Notes](https://docs.saltstack.com/en/latest/topics/releases/3005.1.html)
|
||||||
for the list of changes in SaltStack.
|
for the list of changes in SaltStack.
|
||||||
|
|
||||||
|
**3005.1_2**
|
||||||
|
|
||||||
|
- CI: Improve build times.
|
||||||
|
|
||||||
**3005.1_1**
|
**3005.1_1**
|
||||||
|
|
||||||
- If `SALT_LEVEL_LOGFILE` is not defined, then fallback to `SALT_LOG_LEVEL`.
|
- If `SALT_LEVEL_LOGFILE` is not defined, then fallback to `SALT_LOG_LEVEL`.
|
||||||
|
|||||||
Reference in New Issue
Block a user