-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve CD pipeline to avoid issues with concurrent deployments #2558
Conversation
- name: Generate token for Github PR Bot | ||
id: generate_token | ||
uses: tibdex/github-app-token@v1 | ||
with: | ||
app_id: ${{ secrets.GH_PRBOT_APP_ID }} | ||
private_key: ${{ secrets.GH_PRBOT_APP_PRIVATE_KEY }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm pretty sure this was vestigial?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it might be needed but I guess we'll find out!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason I think this is that we set the default_author
in the add-and-commit
action:
modal-client/.github/workflows/ci-cd.yml
Line 55 in c16cfef
default_author: github_actions |
Which is documented for that action without making reference to this other token pathway.
Meanwhile the docs for the tibdex/github-app-token
action demonstrate using it in subsequent steps though step.<name>.outputs
, which we don't do anywhere in the workflow.
In any case yeah the worst thing that happens if we actually needed this step is that it fails and blocks the deployment so we can iterate further :D.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
e976b19
to
c16cfef
Compare
This PR makes some changes to the CI-CD workflow to better handle concurrent deployments.
It moves the steps that mutate the repository (updating the changelog and bumping the version number) first in the pipeline, so those run before we run any tests. Then the deployment job checks out the commit created when we update the version and deploys that.
This helps avoid an issue with the current configuration, where the deployment job checks out main after waiting for tests to run, meaning that it can includes additional commits that have subsequently been merged (but, critically, have not been validated by CI in a post-merge state).