mirror of
https://github.com/JasonN3/build-container-installer.git
synced 2025-12-25 10:57:55 +01:00
try to cache container image
This commit is contained in:
parent
346fc7b4b3
commit
ad1d258e39
3 changed files with 30 additions and 5 deletions
|
|
@ -19,7 +19,7 @@ VOLUME /build-container-installer/repos
|
||||||
VOLUME /cache
|
VOLUME /cache
|
||||||
|
|
||||||
RUN dnf install -y make && make install-deps
|
RUN dnf install -y make && make install-deps
|
||||||
RUN ln -s ~/.local/share/containers/cache /cache/skopeo
|
RUN ln -s /cache/skopeo /build-container-installer/container && mkdir /cache/dnf
|
||||||
|
|
||||||
ENTRYPOINT ["/bin/bash", "/build-container-installer/entrypoint.sh"]
|
ENTRYPOINT ["/bin/bash", "/build-container-installer/entrypoint.sh"]
|
||||||
|
|
||||||
|
|
|
||||||
2
Makefile
2
Makefile
|
|
@ -190,5 +190,5 @@ test-iso:
|
||||||
$(foreach test,$(_TESTS),chmod +x tests/iso/$(test))
|
$(foreach test,$(_TESTS),chmod +x tests/iso/$(test))
|
||||||
$(foreach test,$(_TESTS),./tests/iso/$(test) deploy.iso)
|
$(foreach test,$(_TESTS),./tests/iso/$(test) deploy.iso)
|
||||||
|
|
||||||
.PHONY: clean install-deps
|
.PHONY: clean install-deps test-iso container/$(IMAGE_NAME)-$(IMAGE_TAG)
|
||||||
|
|
||||||
|
|
|
||||||
31
action.yml
31
action.yml
|
|
@ -47,6 +47,13 @@ inputs:
|
||||||
dnf_cache_key:
|
dnf_cache_key:
|
||||||
description: Overrides the dnf cache key
|
description: Overrides the dnf cache key
|
||||||
required: false
|
required: false
|
||||||
|
enable_cache_skopeo:
|
||||||
|
description: Whether to enable caching for skopeo
|
||||||
|
required: false
|
||||||
|
default: "true"
|
||||||
|
skopeo_cache_key:
|
||||||
|
description: Overrides the skopeo cache key
|
||||||
|
required: false
|
||||||
additional_templates:
|
additional_templates:
|
||||||
description: Space delimetered list of additional Lorax templates to include
|
description: Space delimetered list of additional Lorax templates to include
|
||||||
required: false
|
required: false
|
||||||
|
|
@ -61,7 +68,7 @@ runs:
|
||||||
sudo chmod 777 /cache
|
sudo chmod 777 /cache
|
||||||
|
|
||||||
- name: Load dnf cache
|
- name: Load dnf cache
|
||||||
id: load_cache
|
id: load_dnf_cache
|
||||||
env:
|
env:
|
||||||
dnf_cache_key: dnf-${{ inputs.version }}
|
dnf_cache_key: dnf-${{ inputs.version }}
|
||||||
if: inputs.enable_cache_dnf == 'true'
|
if: inputs.enable_cache_dnf == 'true'
|
||||||
|
|
@ -69,7 +76,16 @@ runs:
|
||||||
with:
|
with:
|
||||||
path: /cache/dnf
|
path: /cache/dnf
|
||||||
key: ${{ inputs.dnf_cache_key || env.dnf_cache_key }}
|
key: ${{ inputs.dnf_cache_key || env.dnf_cache_key }}
|
||||||
restore-keys: ${{ inputs.dnf_cache_key || env.dnf_cache_key }}-${{ github.}}
|
|
||||||
|
- name: Load skopeo cache
|
||||||
|
id: load_skopeo_cache
|
||||||
|
env:
|
||||||
|
skopeo_cache_key: skopeo-${{ inputs.image_name }}-${{ inputs.image_tag }}
|
||||||
|
if: inputs.enable_cache_skopeo == 'true'
|
||||||
|
uses: actions/cache/restore@v4
|
||||||
|
with:
|
||||||
|
path: /cache/skopeo
|
||||||
|
key: ${{ inputs.skopeo_cache_key || env.skopeo_cache_key }}
|
||||||
|
|
||||||
- name: Run docker image
|
- name: Run docker image
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
@ -94,8 +110,17 @@ runs:
|
||||||
- name: Save dnf cache
|
- name: Save dnf cache
|
||||||
env:
|
env:
|
||||||
dnf_cache_key: dnf-${{ inputs.version }}
|
dnf_cache_key: dnf-${{ inputs.version }}
|
||||||
if: inputs.enable_cache_dnf == 'true' && steps.load_cache.outputs.cache-hit == 'false'
|
if: inputs.enable_cache_dnf == 'true' && steps.load_dnf_cache.outputs.cache-hit == 'false'
|
||||||
uses: actions/cache/save@v4
|
uses: actions/cache/save@v4
|
||||||
with:
|
with:
|
||||||
path: /cache/dnf
|
path: /cache/dnf
|
||||||
key: ${{ inputs.dnf_cache_key || env.dnf_cache_key }}
|
key: ${{ inputs.dnf_cache_key || env.dnf_cache_key }}
|
||||||
|
|
||||||
|
- name: Save skopeo cache
|
||||||
|
env:
|
||||||
|
skopeo_cache_key: skopeo-${{ inputs.image_name }}-${{ inputs.image_tag }}
|
||||||
|
if: inputs.enable_cache_skopeo == 'true' && steps.load_skopeo_cache.outputs.cache-hit == 'false'
|
||||||
|
uses: actions/cache/save@v4
|
||||||
|
with:
|
||||||
|
path: /cache/skopeo
|
||||||
|
key: ${{ inputs.skopeo_cache_key || env.skopeo_cache_key }}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue