You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have three environments in Github: dev, staging, and production. Our flow is that we deploy feature branches to dev, and when it is merged deploy to staging and then production. These latter two are both deploying main.
We are using this action with last-successful-event: deployment.
Right now npx nx affected -t deploy gives the following outcomes:
dev: incremental deploy as expected ✅
staging: incremental deploy as expected ✅
production: nothing is deployed as there is already a successful deployment to main ❌
Proposed Solution:
Change the action to accept an optional deployment-environment that will be used when last-successful-event is deployment to differentiate between deployments to different environments.
The text was updated successfully, but these errors were encountered:
Hey, maintainers, do you have any recommendations on how to deal with this situation? There have been no comments so far, so I'm not sure if this is considered a problem to be addressed.
If these are running on a separate workflow, I would run the nx-set-shas in a separate job and then pass the BASE and HEAD as input to the other two jobs/workflows.
Does that make sense? If not, can you provide more detailed example?
Hi @meeroslav , thanks for the reply. I'll expand on our flow. A merge to main triggers a series of automated steps:
Merge PR to main
create deployment to GH environment staging
trigger build & deploy workflow
nx-set-shas with last-successful-event: deployment
nx affected -t deploy
mark deployment success
Separately, we have a manually run action that creates a deployment to GH environment production, kicking off another build & deploy workflow with the same steps. This is typically run after staging has completed, but it in theory can be used to deploy any ref to any env.
Assuming that the production workflow runs after the staging one has completed successfully, running nx-set-shas will return HEAD == BASE because a successful deployment has already been made to main during the staging deployment.
If it was possible to not only find the commit for the last successful deployment, but the commit for the last successful deployment to a specified environment, that would be very useful. Right now we are deploying all services in production for every change.
Running nx-set-shas separately and caching HEAD/BASE or whatever would be technically possible but I don't want to play around with that if the tool can do the work for me. I could probably raise a PR mysef, but I haven't got around to doing so yet in almost a year so who knows if I'd ever get round to it 😅
Our problem:
We have three environments in Github:
dev
,staging
, andproduction
. Our flow is that we deploy feature branches todev
, and when it is merged deploy tostaging
and thenproduction
. These latter two are both deployingmain
.We are using this action with
last-successful-event: deployment
.Right now
npx nx affected -t deploy
gives the following outcomes:dev
: incremental deploy as expected ✅staging
: incremental deploy as expected ✅production
: nothing is deployed as there is already a successful deployment tomain
❌Proposed Solution:
Change the action to accept an optional
deployment-environment
that will be used whenlast-successful-event
is deployment to differentiate between deployments to different environments.The text was updated successfully, but these errors were encountered: