Skip to content

Commit

Permalink
FIXUP: Restore cache appropriately
Browse files Browse the repository at this point in the history
  • Loading branch information
apyrgio committed Oct 2, 2024
1 parent 6ac7892 commit 1705633
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ jobs:
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"

- name: Restore container cache
id: restore-container-cache
- name: Cache container image
id: cache-container-image
uses: actions/cache@v4
with:
key: v2-${{ steps.date.outputs.date }}-${{ hashFiles('Dockerfile', 'dangerzone/conversion/common.py', 'dangerzone/conversion/doc_to_pixels.py', 'dangerzone/conversion/pixels_to_pdf.py', 'poetry.lock', 'gvisor_wrapper/entrypoint.py') }}
Expand All @@ -85,7 +85,7 @@ jobs:
share/image-id.txt
- name: Build and push Dangerzone image
if: ${{ steps.restore-container-cache.outputs.cache-hit != 'true' }}
if: ${{ steps.cache-container-image.outputs.cache-hit != 'true' }}
run: |
sudo apt-get install -y python3-poetry
python3 ./install/common/build-image.py
Expand All @@ -94,4 +94,3 @@ jobs:
podman push \
dangerzone.rocks/dangerzone \
${{ env.IMAGE_REGISTRY }}/dangerzone/dangerzone
22 changes: 12 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,17 @@ jobs:
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"

- name: Restore container cache
id: restore-container-cache
- name: Cache container image
id: cache-container-image
uses: actions/cache@v4
with:
key: v2-${{ steps.date.outputs.date }}-${{ hashFiles('Dockerfile', 'dangerzone/conversion/common.py', 'dangerzone/conversion/doc_to_pixels.py', 'dangerzone/conversion/pixels_to_pdf.py', 'poetry.lock', 'gvisor_wrapper/entrypoint.py') }}
path: |-
share/container.tar.gz
share/image-id.txt
- name: Build and push Dangerzone image
if: ${{ steps.restore-container-cache.outputs.cache-hit != 'true' }}
- name: Build Dangerzone container image
if: ${{ steps.cache-container-image.outputs.cache-hit != 'true' }}
run: |
sudo apt-get install -y python3-poetry
python3 ./install/common/build-image.py
Expand Down Expand Up @@ -148,12 +148,13 @@ jobs:
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"

- name: Restore container cache
uses: actions/cache@v4
uses: actions/cache/restore@v4
with:
key: v2-${{ steps.date.outputs.date }}-${{ hashFiles('Dockerfile', 'dangerzone/conversion/common.py', 'dangerzone/conversion/doc_to_pixels.py', 'dangerzone/conversion/pixels_to_pdf.py', 'poetry.lock', 'gvisor_wrapper/entrypoint.py') }}
path: |-
share/container.tar.gz
share/image-id.txt
fail-on-cache-miss: true

- name: Build Dangerzone .deb
run: |
Expand Down Expand Up @@ -251,14 +252,14 @@ jobs:
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"

- name: Restore container cache
id: restore-container-cache
uses: actions/cache@v4
- name: Restore container image
uses: actions/cache/restore@v4
with:
key: v2-${{ steps.date.outputs.date }}-${{ hashFiles('Dockerfile', 'dangerzone/conversion/common.py', 'dangerzone/conversion/doc_to_pixels.py', 'dangerzone/conversion/pixels_to_pdf.py', 'poetry.lock', 'gvisor_wrapper/entrypoint.py') }}
path: |-
share/container.tar.gz
share/image-id.txt
fail-on-cache-miss: true

- name: Build Dangerzone .rpm
run: |
Expand Down Expand Up @@ -336,13 +337,14 @@ jobs:
--version ${{ matrix.version }} \
build-dev --sync
- name: Restore container cache
uses: actions/cache@v4
- name: Restore container image
uses: actions/cache/restore@v4
with:
key: v2-${{ steps.date.outputs.date }}-${{ hashFiles('Dockerfile', 'dangerzone/conversion/common.py', 'dangerzone/conversion/doc_to_pixels.py', 'dangerzone/conversion/pixels_to_pdf.py', 'poetry.lock', 'gvisor_wrapper/entrypoint.py') }}
path: |-
share/container.tar.gz
share/image-id.txt
fail-on-cache-miss: true

- name: Setup xvfb (Linux)
run: |
Expand Down

0 comments on commit 1705633

Please sign in to comment.