Idea-Pool / js-assertion-cheat-sheet

This repository contains examples of various, often used, and tricky assertions in the common JS assertion tools.
https://js-assertion.ideapool.community/
Other
2 stars 3 forks source link

Set Up Feature Branch Deployment #7

Closed kornel-filep closed 5 months ago

kornel-filep commented 8 months ago

Configure additional pipelines for feature branches. Feature branches match with the regex "[0-9]+-**" (Github Issue regex). This pipeline should be manual trigger only and should not be activated for the main branch.

Once a feature branch has been initially deployed, the URL established should remain constant. Along with this, we need to set up a separate pipeline for AWS CDK Stack cleanup, enabling us to tidy up the environment when necessary (destroy the whole stack).

Acceptance Criteria:

  1. Github Actions pipeline is in place for feature branch deployments to AWS.
  2. The pipeline should only trigger manually (workflow dispatch) for branches matching the "[0-9]+-**" regex.
  3. It should not be available for the main branch.
  4. The URL for a deployed feature branch remains constant after its first deployment.
  5. Updates to a feature branch and manual deployment only change the website content, not the URL (after first deployment).
  6. A second pipeline is available for complete AWS CDK Stack cleanup.
kyouka5 commented 7 months ago

After pushing two pipelines to my branch, I have just noticed that I am not able to trigger them under the Actions tab. I did some digging, and found that pipelines with workflow_dispatch trigger can not be triggered as long as they are not in the main branch:

To trigger the workflow_dispatch event, your workflow must be in the default branch. For more information about configuring the workflow_dispatch event, see "Events that trigger workflows."

Source

A solution for this problem could be to change the trigger in the pipelines to push while we are still testing our changes, and then before opening a PR we could update the trigger to be workflow_dispatch.

@kornel-filep What do you think, maybe do you have any better ideas in mind?

FYI @t0mmili @taughty

kornel-filep commented 7 months ago

@kornel-filep What do you think, maybe do you have any better ideas in mind?

Sure that works for me @kyouka5.

kyouka5 commented 7 months ago

After a discussion with @kornel-filep, it was decided that we are going to follow a different approach to feature branches than what we had initially considered. The changes are as follows:

kornel-filep commented 7 months ago

@t0mmili please check the above message from @kyouka5 as it potentially has impact on the main branch pipelines.

The idea is that the main brach will be deployed on BASE_URL/ and the feature branches will be on BASE_URL/BRANCH/ endpoints. This potentially has implications on how the feature and main branch pipelines work in tandem.