GithubHelp home page GithubHelp logo

Comments (18)

rstacruz avatar rstacruz commented on May 31, 2024 1

I took some screenshots of my settings. Might help with updating documentation.

image

image

from actions-netlify.

rstacruz avatar rstacruz commented on May 31, 2024 1

I was looking at the netlify cli and found that you can't specify alias and prod at the same time.

› yarn netlify deploy --dir public --alias v2020 --prod --message 'Manual'

   Error: --prod and --alias flags cannot be used at the same time

Removing alias from the configuration works - the deployment now becomes the "main" deploy :)

from actions-netlify.

nwtgck avatar nwtgck commented on May 31, 2024

@rstacruz Hi!

Your "main deployment" is called "production deployment" in this action. You can use production-branch: master to deploy every commit on master branch to my-site.netlify.app. You can also specify production-deploy: ${{ some condition }} to control the "production deployment", so production-deploy: true means every commit to every branch deploys my-site.netlify.app.

To know the reason why "production deployment" is used, you can see the discussion on #102 (comment). But your word, "main" is very good. Some day we can deprecate "production-ooo" and use "main-ooo".

from actions-netlify.

rstacruz avatar rstacruz commented on May 31, 2024

Thanks! I tried setting production-branch: master and production-deploy: true, but it didn't quite work (https://github.com/rstacruz/til/blob/d152a20914842fc758ffbf67ab713bce7ed2e091/.github/workflows/build.yml). I'll try to investigate some more.

from actions-netlify.

nwtgck avatar nwtgck commented on May 31, 2024

@rstacruz I can see https://rstacruz-tilnext.netlify.app on the commit comment. Is it the main deploy?

image

(from: rstacruz/til-2020@d152a20#commitcomment-40210621 )

from actions-netlify.

rstacruz avatar rstacruz commented on May 31, 2024

Yeah - however I think it's not showing up because I turned off builds in Netlify maybe? rstacruz-tilnext.netlify.app still shows an old version right now 🤔, though the other URL is okay.

I think this might be a problem on my end of configuration, don't worry too much, just thought I'd let you know the caveats I'm running into :)

from actions-netlify.

rstacruz avatar rstacruz commented on May 31, 2024

I think this may be the source of my issue. Netlify has a "auto publishing" feature under the Deploys tab. It has to be turned on to publish builds.

Here's what the settings would look like if it was off:

The only way to edit this setting is through the Deploys tab. Note that the setting will be invisible if Builds are off... in which case, builds have to be turned back on, then enable auto-publishing, then disable builds after that. If builds are off, it will look like this:

Turning this on only fixed pushing to v2020--rstacruz-tilnext.netlify.app for me, but not the main site (rstacruz-tilnext.netlify.app) unfortunately.

from actions-netlify.

nwtgck avatar nwtgck commented on May 31, 2024

@rstacruz Unfortunately, I could understand your situation well. Could you tell me "Production branch" in the "Deploy contexts" on "Build & deploy"? Here is my setting.
image

Navigation: Settings > Build & deploy > Deploy contexts

from actions-netlify.

rstacruz avatar rstacruz commented on May 31, 2024

Oh hilarious, I just did a very similar thing just now (set it to a non-existent branch)! I'll play around with it and report back when I get to my laptop.

from actions-netlify.

rstacruz avatar rstacruz commented on May 31, 2024

Would you accept a PR to throw an error when alias is used when production-deploy: true is also given?

I've also found that disabling builds on Netlify should be okay. The non-existent-branch workaround didn't seem like it was necessary.

from actions-netlify.

nwtgck avatar nwtgck commented on May 31, 2024

@rstacruz
First, thank you so much for your reporting and investigation! Deployment related to "production" deploy is very important thing.

Would you accept a PR to throw an error when alias is used when production-deploy: true is also given?

Here are candidates to solve this problem when alias: ... and draft === false (internal implementation, it means "production deploy").

  • Throw error
  • Ignore "alias" deploy and do "production" deploy only
  • Do both "alias" deploy and "production" deploy (run await netlifyClient.deploy() twice internally)

"Throw error" is good to notify users and correct their usages. But, fail of CI might make GitHub Actions users uncomfortable because "production" deploy, which is very important and is triggered in a specific condition usually.

"Ignore alias" and notify users with warning is also a candidate not to fail the CI and deploy the important "production".

Deploying both may be our expectation. Although run await netlifyClient.deploy() twice internally, it may be what we should.

from actions-netlify.

nwtgck avatar nwtgck commented on May 31, 2024

Should we change the title?

from actions-netlify.

rstacruz avatar rstacruz commented on May 31, 2024

Should we change the title?

Feel free to edit the title to what you feel is best :)

from actions-netlify.

rstacruz avatar rstacruz commented on May 31, 2024

The behaviour is up to you, but my personal preference is to throw an error.

  • it's least surprising for those who use netlify-cli since it mirrors its behaviour
  • deploying twice will make 2 deploys show up, making it a bit surprising

My second preference would be to let it through and show a warning ("warning: ignoring 'alias'. Aliases are not supported in production mode").

... Just my 2 cents as a casual netlify user - I'd be happy with whatever you decide :)

from actions-netlify.

devotox avatar devotox commented on May 31, 2024

@rstacruz @nwtgck - Just ran into this exact problem!

I would say if its a production build then it does not need to be built twice. just ignore the alias and not show the second URL either

from actions-netlify.

nwtgck avatar nwtgck commented on May 31, 2024

@rstacruz @devotox

Thank you for your patience. I'll solve this problem in #260 .

from actions-netlify.

devotox avatar devotox commented on May 31, 2024

@nwtgck Wow you are quick!

from actions-netlify.

nwtgck avatar nwtgck commented on May 31, 2024

@rstacruz @devotox

I released 1.1.6 to fix this problem. Let me know when you find a problem!

from actions-netlify.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.