From 3060207668a784099642f10f4d00efbd752ca57f Mon Sep 17 00:00:00 2001 From: Dmitri Smirnov Date: Wed, 24 Apr 2024 19:52:28 -0400 Subject: [PATCH] fix cache 3 --- .github/workflows/release.yml | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 853c90e..5976783 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 @@ -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 @@ -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