Skip to content

Commit

Permalink
fix cache 3
Browse files Browse the repository at this point in the history
  • Loading branch information
plexoos committed Apr 24, 2024
1 parent 6dce7a9 commit 3060207
Showing 1 changed file with 21 additions and 9 deletions.
30 changes: 21 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@ jobs:
needs: test
steps:
- name: Define environment variables
run: echo IMAGE_SHA=ghcr.io/$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]'):${{ github.sha }} >> $GITHUB_ENV
run: |
echo IMAGE_SHA=ghcr.io/$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]'):${{ github.sha }} >> $GITHUB_ENV
echo IMAGE_REG=ghcr.io/$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
- name: Checkout Code
uses: actions/checkout@v4
Expand All @@ -125,19 +127,28 @@ jobs:
# ${{ steps.semantic.outputs.new_release_version }}
# docker push ghcr.io/${{ github.repository_owner }}/esi-opticks:${{ github.sha }}

- run: echo ${{ steps.semantic.outputs.new_release_git_tag }}
- run: echo ${{ steps.semantic.outputs.new_release_version }}

- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ steps.semantic.outputs.new_release_git_tag }}

- name: Download image
uses: actions/download-artifact@v4
#- name: Download image
# uses: actions/download-artifact@v4
# with:
# name: esi-opticks-${{ github.sha }}
# path: /tmp

- name: Cache Docker layers
uses: actions/cache@v3
with:
name: esi-opticks-${{ github.sha }}
path: /tmp
path: /tmp/buildx-cache
key: esi-opticks-${{ github.sha }}

- name: Load Image
run: docker load --input /tmp/esi-opticks-${{ github.sha }}.tar
run: docker load --input /tmp/buildx-cache/esi-opticks-${{ github.sha }}.tar

- name: Set up Docker buildx
uses: docker/setup-buildx-action@v3
Expand All @@ -147,9 +158,10 @@ jobs:
with:
file: Dockerfile.test
tags: |
ghcr.io/$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]'):${{ steps.semantic.outputs.new_release_version }}
ghcr.io/$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]'):latest
${{ env.IMAGE_REG }}:${{ steps.semantic.outputs.new_release_version }}
${{ env.IMAGE_REG }}:latest
push: true
cache-from: type=registry,ref=${{ env.IMAGE_SHA }}
cache-from: ${{ env.IMAGE_SHA }}
#cache-from: type=registry,ref=${{ env.IMAGE_SHA }}
#cache-to: type=inline
#outputs: type=docker,dest=/tmp/esi-opticks-${{ github.sha }}.tar

0 comments on commit 3060207

Please sign in to comment.