-
Hi, I'd like to understand why github-pages-deploy-action uses a force push in the deploy function. I have two jobs that are using this action. One updates my documentation pages and one creates a badge and pushes to gp-pages for reference from the README (see https://github.com/PandABlocks/PandABlocks-client/tree/master/.github/workflows). I perceive that creates a possible race condition. If the checkout and force push from both jobs overlap then one of the sets of changes will be lost. I would be happy to PR a parameter to allow the user to choose force or not (with default force) however you may have very good reason for force that would mean this breaks things? I think my scenario would work with no force and would merge the changes if an overlap occurs (because the two jobs update totally different files so there should be no conflicts). Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
You should have each job be dependent on each other, that way you're not deploying at the same time. The GitHub actions workflow has a way to do this using the We're making a series of changes for version 4 with the idea of simplifying the API so I'm not fond of adding another input for a single use case. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the fast response. I have documentation build in a separate workflow, as well as improving build time it also makes the actions YML neater because of the way GA triggers and filters apply to workflow/job/action. I take your point and will ensure the git actions are serial. Thanks |
Beta Was this translation helpful? Give feedback.
-
I'm having thoughts on the force push, too. My proposal would be to only force if the history reset is requested, and not force otherwise. In case of race conditions like the one here, that would result in builds failing. Which makes sense to me, but I'm also a VCS nerd that likes history-preserving processes ;-) |
Beta Was this translation helpful? Give feedback.
-
My workflow is the next: develop branch, push -> generate docs on The problem is I am losing one of the documentation based on the latest push. Is there an example of how I can avoid this problem? I don't want to generate both docs at the same time because that means building the project two times for each branch... |
Beta Was this translation helpful? Give feedback.
-
Ah, OK, this becomes a little more clear then. This is more a question about the If you don't mind old files lingering around, you can just switch that off. Otherwise, you should probably use a target folder for |
Beta Was this translation helpful? Give feedback.
You should have each job be dependent on each other, that way you're not deploying at the same time. The GitHub actions workflow has a way to do this using the
needs
keyword. Force push or not that's likely to be error prone if you have to two Git tasks running async.We're making a series of changes for version 4 with the idea of simplifying the API so I'm not fond of adding another input for a single use case.