Workflow cache
This commit is contained in:
@@ -49,6 +49,14 @@ jobs:
|
|||||||
username: ${{ secrets.REGISTRY_USER }} # e.g. admin
|
username: ${{ secrets.REGISTRY_USER }} # e.g. admin
|
||||||
password: ${{ secrets.REGISTRY_PASSWORD }} # e.g. <api‑token>
|
password: ${{ secrets.REGISTRY_PASSWORD }} # e.g. <api‑token>
|
||||||
|
|
||||||
|
- name: Cache Docker layers
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: /tmp/.buildx-cache
|
||||||
|
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-buildx-
|
||||||
|
|
||||||
# ------------------------------------------------------------------
|
# ------------------------------------------------------------------
|
||||||
# 4. Build the Docker image
|
# 4. Build the Docker image
|
||||||
# ------------------------------------------------------------------
|
# ------------------------------------------------------------------
|
||||||
@@ -67,6 +75,8 @@ jobs:
|
|||||||
build-args: |
|
build-args: |
|
||||||
# Add any build args here
|
# Add any build args here
|
||||||
# ARG_NAME=VALUE
|
# ARG_NAME=VALUE
|
||||||
|
cache-from: type=local,src=/tmp/.buildx-cache
|
||||||
|
cache-to: type=local,dest=/tmp/.buildx-cache
|
||||||
|
|
||||||
# ------------------------------------------------------------------
|
# ------------------------------------------------------------------
|
||||||
# 5. Push the image to the registry
|
# 5. Push the image to the registry
|
||||||
@@ -81,6 +91,8 @@ jobs:
|
|||||||
${{ vars.REGISTRY_HOST }}/${{ steps.github_repository_to_lowercase.outputs.lowercase }}:${{ github.sha }}
|
${{ vars.REGISTRY_HOST }}/${{ steps.github_repository_to_lowercase.outputs.lowercase }}:${{ github.sha }}
|
||||||
${{ vars.REGISTRY_HOST }}/${{ steps.github_repository_to_lowercase.outputs.lowercase }}:${{ github.ref_name }}
|
${{ vars.REGISTRY_HOST }}/${{ steps.github_repository_to_lowercase.outputs.lowercase }}:${{ github.ref_name }}
|
||||||
${{ vars.REGISTRY_HOST }}/${{ steps.github_repository_to_lowercase.outputs.lowercase }}:latest
|
${{ vars.REGISTRY_HOST }}/${{ steps.github_repository_to_lowercase.outputs.lowercase }}:latest
|
||||||
|
cache-from: type=local,src=/tmp/.buildx-cache
|
||||||
|
cache-to: type=local,dest=/tmp/.buildx-cache
|
||||||
|
|
||||||
# ------------------------------------------------------------------
|
# ------------------------------------------------------------------
|
||||||
# 6. (Optional) Clean up local Docker cache
|
# 6. (Optional) Clean up local Docker cache
|
||||||
|
|||||||
Reference in New Issue
Block a user