Issues with different caching paths between different images

Im currently using this setup:

    working_directory: ~/build
    docker:
        - image: circleci/node:9.11.2

      - checkout
      - save_cache:
          key: v1-repo-{{ .Branch }}-{{ .Revision }}
          paths:
            - .

Then im restorin the repo time and time and it works for most jobs in the workflow. With this message

Found a cache from build 296 at v1-repo-dev-3da7c6d6593720cbd32c450c1b6dcebec3db119e
Size: 21 MB
Cached paths:
  * /home/circleci/build

But something strange happens when i suddenly enter google/cloud-sdk image.
It fails because it doesnt find the files in the root of my repo. With a different folder than cache.

ERROR: (gcloud.beta.app.deploy) [/root/build/app-dev.yaml] does not exist.

Does circle ci use the whole cached paths for unarchiving, or what happens, why cant i find my app.yaml file? I had very similar problems when caching the nodemodules, but I solved that with a different approach which i cant use here.

Or is it something else going on?

UPDATE:
I have some debug data:
Im running these commands:

pwd
ls
echo "/home/circleci/build/"
ls /home/circleci/build/

/root/build
client	node_modules  src
/home/circleci/build/
README.md	 cicd_docs.md	    contracts	      src
app-dev.yaml	 cicd_overview.png  frontend_docs.md  test
app.yaml	 client		    nodemon.json      tools
backend_docs.md  contract_docs.md   package.json      yarn.lock

There we can see that everything is put in the full path that is cached. But it is not from where this new image is working

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.