ci(cicd-wkflow): separate deployment from release job to enable job re-runs #1086
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose
Rationale
It is better design to have a separate deploy job rather than one job to release and deploy because if your deployment fails for some reason (auth token or other mishap) then you have a release tag on the repository but no distribution artifact. Normally you might just update the auth token but this time you have to reverse most of the release job to do it again rather than just re-running the deployment. I have also found this reigns true if you have multiple deployment locations. You should have each deployment location as a separate job so they can independently fail (and not prevent others) and you can re-deploy (via job re-run) them individually if needed. It can be difficult to republish as most registries will fail if it has already an existing artifact of the same version.
How did you test?
How to Verify