jsmrcaga / action-netlify-deploy

MIT License
102 stars 32 forks source link

Error: Site not found. Please rerun "netlify link" #51

Open tpluscode opened 1 year ago

tpluscode commented 1 year ago

I don't know why, my deployments stopped working after a period of inactivity:

Error: Site not found. Please rerun "netlify link"

I did not do anything. Now I recreated the access token and made sure that the SITE ID is correct but still the action fails. Have you seen this before?

jsmrcaga commented 1 year ago

Hi @tpluscode ! I have not! It looks like the CLI does not know anymore what site you are talking about https://docs.netlify.com/cli/get-started/#link-and-unlink-sites

From what I can see in the docs the link command just adds an id to the .netlify/state.json of your project. BUT https://docs.netlify.com/cli/get-started/#link-with-an-environment-variable

Link with an environment variable
Alternatively, you can link to a site by finding the site ID
in the Netlify UI, then adding it to your local terminal environment:

Go to 
Site configuration > General > Site details > Site information,
and copy the value for Site ID.

Assign the ID to a NETLIFY_SITE_ID environment variable,
in your terminal settings or in the UI of a Continuous Integration (CI) tool.

So having set the NETLIFY_SITE_ID env var should be enough.

Can you verify if your env var is still ok and matches your project ?

Since we are using the Github-bundled version of netlify-cli they might have updated it :/ inconvenient for actions now that I think about it

tpluscode commented 1 year ago

What I did was to complete recreate that site on netlify and changed the site id. It deployed successfully then. Will try your suggestions if I encounter this again