Comments (18)
I took some screenshots of my settings. Might help with updating documentation.
from actions-netlify.
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.
@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.
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.
@rstacruz I can see https://rstacruz-tilnext.netlify.app on the commit comment. Is it the main deploy?
(from: rstacruz/til-2020@d152a20#commitcomment-40210621 )
from actions-netlify.
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.
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.
@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.
Navigation: Settings > Build & deploy > Deploy contexts
from actions-netlify.
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.
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.
@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.
Should we change the title?
from actions-netlify.
Should we change the title?
Feel free to edit the title to what you feel is best :)
from actions-netlify.
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.
@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.
Thank you for your patience. I'll solve this problem in #260 .
from actions-netlify.
@nwtgck Wow you are quick!
from actions-netlify.
I released 1.1.6 to fix this problem. Let me know when you find a problem!
from actions-netlify.
Related Issues (20)
- output deploy id
- Invalid action input 'enable-github-deployment' HOT 6
- Release HOT 2
- Error: Unprocessable Entity HOT 2
- Update node version to 20 HOT 1
- Page Not Found for Remix + Vite App HOT 1
- No such file or directory when deploying HOT 3
- Netlify preview build not using netlify.toml HOT 2
- netlify-config-path not working for me HOT 1
- Production deployment not working HOT 1
- How to delete deploy preview on PR merge? HOT 4
- Critical security issue with preview deployments HOT 5
- Netlify Large Media? HOT 1
- Upload crashes when using TS files in the 'functions' folder HOT 2
- Wich is the right publish-dir path to Nextjs? HOT 4
- Deprecation warning for Node 12 HOT 7
- (More) deprecation warning for Node 12 HOT 2
- ✨ add input to enable/disable github deployment
- Post 2 comments for two separate builds HOT 1
- Support for edge-functions HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from actions-netlify.