Netlify-cli deploys with --alias has cache?

Dear Community,

In our Gitlab CI/CD pipeline, when we issue the command:

netlify deploy --alias "$CI_COMMIT_REF_NAME" --message "Deployado desde rama $CI_COMMIT_REF_NAME commit $CI_COMMIT_SHORT_SHA"

Everything seems fine:

Website Draft URL:

But the changes are not the latest deployed. But, if I open this unique URL:

This URL is the right. Its work fine and have the latest changes deployed.

Why the alias URL is not refreshed with the latest changes and the unique URL works fine ?

Our Site-ID is: 02c9b8d5-c0c9-40a9-8d51-f9c86b793d80

Thanks in advance, and best regards.

P.D.: Soy for my bad English.

P.D.2: The $CI_COMMIT_REF_NAME env var contains the “master” string. I double checked that.

Hi, @Gedco_Sistemas. Alias deploys are not branch deploys. I go into more detail about why this is so here:

If there are question after reading that, please let us know.

Dear @luke, thanks for your quick reply.

Ok, I learn that Alias deploys aren’t branches deploy. So, what’s is the alias flag for ? I can’t imagine an use case for this…

  • alias ( string ) - Specifies the alias for deployment. Useful for creating predictable deployment URL’s

Hi, @Gedco_Sistemas. It is for exactly what is says: “Useful for creating predictable deployment URL’s”.

It is just important to understand that they are not treated in the same ways as branch deploys (because they aren’t).

Hi, ok.

Sorry, but then why when I use --alias master to deploy, I don’t see the last changes I made push?

Is ‘master’ a reserved word? Should I have to use another word to test, such as cat or dog? Then there would be a ?

Hi, @Gedco_Sistemas. It was reserved when you deployed a branch with that same name, master. So now that subdomain (master--mcc-adm-es) is reserved for branch deploys to that branch. If you try to use it as an alias it fails to update because it was already used for a branch deploy. The branch deploy take precedence over the alias.

Perfect. Thank you very much for the patience and time invested in clarifying our doubts.

We have been using Netlify for a while and we are very pleased with the service.

Keep the good work. Cheers from Buenos Aires.

1 Like