Skip to content

Commit

Permalink
Enable Docker image layer caching in CI/CD workflow
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Moore <[email protected]>
  • Loading branch information
drmrd committed Dec 1, 2023
1 parent 0c904d2 commit d99cf5e
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/cicd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,14 @@ jobs:
strategy:
matrix:
include:
- image: ghcr.io/us-joet/everest-demo/manager
- host_namespace: ghcr.io/us-joet/everest-demo
image_name: manager
context: ./manager
- image: ghcr.io/us-joet/everest-demo/mqtt-server
- host_namespace: ghcr.io/us-joet/everest-demo
image_name: mqtt-server
context: ./mosquitto
- image: ghcr.io/us-joet/everest-demo/nodered
- host_namespace: ghcr.io/us-joet/everest-demo
image_name: nodered
context: ./nodered

steps:
Expand Down Expand Up @@ -50,11 +53,11 @@ jobs:
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ matrix.image }}
images: ${{ matrix.host_namespace }}/${{ matrix.image_name }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern=${{ steps.docker-image-version-check.SEMVER }}
type=semver,pattern=${{ steps.docker-image-version-check.outputs.SEMVER }}
- name: Log into GitHub container registry
uses: docker/login-action@v3
Expand All @@ -70,3 +73,5 @@ jobs:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha,scope=${{ matrix.image_name }}
cache-to: type=gha,mode=max,scope=${{ matrix.image_name }}

0 comments on commit d99cf5e

Please sign in to comment.