Skip to content

Commit 01e7fb6

Browse files
authored
feat: Release flow (#851)
<!--- Provide a general summary of your changes in the Title above --> ## Description 💬 <!--- Describe your changes in detail --> ## Motivation and Context 🥅 <!--- Why is this change required? What problem does it solve? --> <!--- If it fixes an open issue, please link to the issue here. --> ## How has this been tested? 🧪 <!--- Please describe in detail how you tested your changes. --> <!--- Include details of your testing environment, tests ran to see how --> <!--- your change affects other areas of the code, etc. --> - [ ] Local build ⚒️ - [ ] Local tests 🧪 - [ ] (optional) Local run and endpoint tested in swagger 🚀 ## Screenshots (if appropriate) 💻 ## Types of changes 🌊 <!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [x] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] Maintenance (e.g. dependency updates, minor rewrites, code style changes) ## Checklist ☑️ <!--- Go over all the following points, and put an `x` in all the boxes that apply. --> <!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> - [ ] The pull request title starts with the jira case number (when applicable), e.g. "TEST-1234 Add some feature" - [ ] The person responsible for following up on requested review changes has been assigned to the pull request - [ ] My code follows the code style of this project. - [ ] My change requires a change to the documentation. - [ ] I have updated the documentation accordingly. ## Highly optional checks, only use these if you have a reason to do so ✔️ - [ ] This PR changes the database so I have added the *create-diagram* label to assist reviewers with a db diagram - [ ] This PR changes platform or backend and I need others to be able to test against these changes before merging to dev, so I have added the *deploy-azure* label to deploy before merging the PR ## Checklist for the approver ✅ - [ ] I've checked the files view for spelling issues, code quality warnings and similar - [ ] I've waited until all checks have passed (green check/without error) - [ ] I've checked that only the intended files are changed
1 parent 1e97725 commit 01e7fb6

13 files changed

+142
-358
lines changed

.github/dependabot.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ updates:
1010
- "/"
1111
- "/.github/actions/*/"
1212
open-pull-requests-limit: 20
13-
target-branch: "dev"
13+
target-branch: "main"
1414
schedule:
1515
interval: "daily"
1616
assignees:
@@ -22,7 +22,7 @@ updates:
2222
- "/src/backend/WebApi"
2323
- "/src/frontend"
2424
open-pull-requests-limit: 20
25-
target-branch: "dev"
25+
target-branch: "main"
2626
schedule:
2727
interval: "daily"
2828
assignees:
@@ -31,7 +31,7 @@ updates:
3131
- package-ecosystem: "nuget"
3232
directory: "/src/backend"
3333
open-pull-requests-limit: 20
34-
target-branch: "dev"
34+
target-branch: "main"
3535
schedule:
3636
interval: "daily"
3737
assignees:
@@ -61,7 +61,7 @@ updates:
6161
- package-ecosystem: "npm"
6262
directory: "/src/frontend"
6363
open-pull-requests-limit: 20
64-
target-branch: "dev"
64+
target-branch: "main"
6565
schedule:
6666
interval: "weekly"
6767
day: "sunday"
@@ -115,7 +115,7 @@ updates:
115115
- package-ecosystem: "npm"
116116
directory: "/tests/playwright"
117117
open-pull-requests-limit: 20
118-
target-branch: "dev"
118+
target-branch: "main"
119119
schedule:
120120
interval: "weekly"
121121
day: "sunday"

.github/workflows/backend-ci.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
workflow_dispatch:
55
push:
66
branches:
7-
- dev
7+
- main
88
tags:
99
- "v*"
1010
paths:
@@ -13,8 +13,6 @@ on:
1313
pull_request:
1414
branches:
1515
- main
16-
- test
17-
- dev
1816
paths:
1917
- "src/backend/**"
2018
- "tests/backend/**"

.github/workflows/deploy-cd-trigger.yml

Lines changed: 22 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ on:
55
push:
66
branches:
77
- main
8-
- qa
9-
- test
10-
- dev
118
paths:
129
- "src/**"
1310
- "templates/terraform/**"
@@ -54,42 +51,42 @@ jobs:
5451
echo "labels=$labels" >> $GITHUB_OUTPUT
5552
echo "labels=$labels"
5653
57-
call-deploy-workflow-main:
58-
if: ${{ github.ref == 'refs/heads/main' || (github.event_name == 'pull_request' && github.base_ref == 'main' && github.event.pull_request.draft == false) }}
54+
deploy-dev:
55+
if: ${{ github.ref == 'refs/heads/main' || (github.event_name == 'pull_request' && contains(needs.conditions.outputs.labels, 'deploy-azure')) }}
5956
needs: [conditions]
6057
uses: hwinther/test/.github/workflows/deploy-cd.yml@main
6158
with:
62-
deploy_target: prod
63-
repo_name: main
59+
deploy_target: dev
60+
repo_name: dev
6461
labels: ${{ needs.conditions.outputs.labels }}
6562
secrets: inherit
6663

67-
call-deploy-workflow-qa:
68-
if: ${{ github.ref == 'refs/heads/qa' || (github.event_name == 'pull_request' && github.base_ref == 'qa' && github.event.pull_request.draft == false) }}
69-
needs: [conditions]
70-
uses: hwinther/test/.github/workflows/deploy-cd.yml@qa
64+
deploy-test:
65+
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }}
66+
needs: [conditions, deploy-dev]
67+
uses: hwinther/test/.github/workflows/deploy-cd.yml@main
7168
with:
72-
deploy_target: qa
73-
repo_name: qa
69+
deploy_target: test
70+
repo_name: test
7471
labels: ${{ needs.conditions.outputs.labels }}
7572
secrets: inherit
7673

77-
call-deploy-workflow-test:
78-
if: ${{ github.ref == 'refs/heads/test' || (github.event_name == 'pull_request' && github.base_ref == 'test' && github.event.pull_request.draft == false) }}
79-
needs: [conditions]
80-
uses: hwinther/test/.github/workflows/deploy-cd.yml@test
74+
deploy-qa:
75+
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }}
76+
needs: [conditions, deploy-test]
77+
uses: hwinther/test/.github/workflows/deploy-cd.yml@main
8178
with:
82-
deploy_target: test
83-
repo_name: test
79+
deploy_target: qa
80+
repo_name: qa
8481
labels: ${{ needs.conditions.outputs.labels }}
8582
secrets: inherit
8683

87-
call-deploy-workflow-dev:
88-
if: ${{ github.ref == 'refs/heads/dev' || (github.event_name == 'pull_request' && contains(needs.conditions.outputs.labels, 'deploy-azure')) }}
89-
needs: [conditions]
90-
uses: hwinther/test/.github/workflows/deploy-cd.yml@dev
84+
deploy-prod:
85+
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }}
86+
needs: [conditions, deploy-qa]
87+
uses: hwinther/test/.github/workflows/deploy-cd.yml@main
9188
with:
92-
deploy_target: dev
93-
repo_name: dev
89+
deploy_target: prod
90+
repo_name: main
9491
labels: ${{ needs.conditions.outputs.labels }}
9592
secrets: inherit

.github/workflows/enable-auto-merge.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,6 @@ jobs:
3030
PR_NUMBER: ${{ github.event.number }}
3131
run: gh pr merge --squash --auto $PR_NUMBER
3232

33-
- name: Enable auto merge on github actions PRs related to environment promotions
34-
if: ${{ github.event.pull_request.draft == false && (github.head_ref == 'main' || github.head_ref == 'qa' || github.head_ref == 'test' || github.head_ref == 'dev') }}
35-
env:
36-
GH_TOKEN: ${{ secrets.WORKFLOW_TOKEN }}
37-
PR_NUMBER: ${{ github.event.number }}
38-
run: gh pr merge --merge --auto $PR_NUMBER
39-
4033
# Works only for for single person repo, or potentially it can be expanded on with a key for each user
4134
# - name: Enable auto merge on feature PRs
4235
# uses: daneden/enable-automerge-action@v1

.github/workflows/frontend-ci.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,14 @@ on:
44
workflow_dispatch:
55
push:
66
branches:
7-
- dev
7+
- main
88
tags:
99
- "v*"
1010
paths:
1111
- "src/frontend/**"
1212
pull_request:
1313
branches:
1414
- main
15-
- test
16-
- dev
1715
paths:
1816
- "src/frontend/**"
1917
- ".github/workflows/frontend-ci.yml"
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: "Playwright CI"
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
tags:
9+
- "v*"
10+
paths:
11+
- "/**"
12+
pull_request:
13+
branches:
14+
- main
15+
paths:
16+
- "tests/playwright/**"
17+
- ".github/workflows/playwright-ci.yml"
18+
types: [opened, reopened, labeled, synchronize, ready_for_review]
19+
20+
# Sets permissions of the GITHUB_TOKEN to allow creating checks and updating PR
21+
permissions:
22+
contents: read
23+
checks: write
24+
pull-requests: write
25+
26+
# This allows a subsequently queued workflow run to interrupt previous runs
27+
concurrency:
28+
group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
29+
cancel-in-progress: true
30+
31+
env:
32+
NODE_VERSION: "24"
33+
WORKFLOW_SHORT_NAME: "playwright"
34+
FRONTEND_PATH: "tests/playwright"
35+
TRAILING_AGENT_WORK_PATH: "/home/runner/work/test/test/"
36+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
38+
jobs:
39+
build:
40+
runs-on: ubuntu-latest
41+
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }}
42+
defaults:
43+
run:
44+
working-directory: ${{ env.FRONTEND_PATH }}
45+
steps:
46+
- name: Checkout
47+
uses: actions/checkout@v6
48+
49+
- uses: ./.github/actions/frontend-build
50+
with:
51+
working_directory: ${{ env.FRONTEND_PATH }}
52+
package_manager: "npm"
53+
run_tests: "true"

.github/workflows/playwright-env.yml

Lines changed: 25 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,9 @@ name: "Playwright e2e tests - environment"
22

33
on:
44
workflow_dispatch:
5-
push:
6-
branches:
7-
- qa
8-
- test
95
pull_request:
106
branches:
117
- main
12-
- qa
13-
- test
14-
- dev
158
- "feature/*"
169
- "bugfix/*"
1710
paths:
@@ -30,33 +23,33 @@ concurrency:
3023
cancel-in-progress: true
3124

3225
jobs:
33-
call-workflow-main:
26+
# call-workflow-main:
27+
# if: ${{ github.ref == 'refs/heads/main' || (github.event_name == 'pull_request' && github.base_ref == 'main' && github.event.pull_request.draft == false) }}
28+
# uses: hwinther/test/.github/workflows/playwright.yml@main
29+
# with:
30+
# deploy_target: prod
31+
# repo_name: main
32+
# url_prefix: ""
33+
# secrets: inherit
34+
# call-workflow-qa:
35+
# if: ${{ github.ref == 'refs/heads/qa' || (github.event_name == 'pull_request' && github.base_ref == 'qa' && github.event.pull_request.draft == false) }}
36+
# uses: hwinther/test/.github/workflows/playwright.yml@main
37+
# with:
38+
# deploy_target: qa
39+
# repo_name: qa
40+
# url_prefix: qa-
41+
# secrets: inherit
42+
# call-workflow-test:
43+
# if: ${{ github.ref == 'refs/heads/test' || (github.event_name == 'pull_request' && github.base_ref == 'test' && github.event.pull_request.draft == false) }}
44+
# uses: hwinther/test/.github/workflows/playwright.yml@main
45+
# with:
46+
# deploy_target: test
47+
# repo_name: test
48+
# url_prefix: test-
49+
# secrets: inherit
50+
call-workflow-dev:
3451
if: ${{ github.ref == 'refs/heads/main' || (github.event_name == 'pull_request' && github.base_ref == 'main' && github.event.pull_request.draft == false) }}
3552
uses: hwinther/test/.github/workflows/playwright.yml@main
36-
with:
37-
deploy_target: prod
38-
repo_name: main
39-
url_prefix:
40-
secrets: inherit
41-
call-workflow-qa:
42-
if: ${{ github.ref == 'refs/heads/qa' || (github.event_name == 'pull_request' && github.base_ref == 'qa' && github.event.pull_request.draft == false) }}
43-
uses: hwinther/test/.github/workflows/playwright.yml@qa
44-
with:
45-
deploy_target: qa
46-
repo_name: qa
47-
url_prefix: qa-
48-
secrets: inherit
49-
call-workflow-test:
50-
if: ${{ github.ref == 'refs/heads/test' || (github.event_name == 'pull_request' && github.base_ref == 'test' && github.event.pull_request.draft == false) }}
51-
uses: hwinther/test/.github/workflows/playwright.yml@test
52-
with:
53-
deploy_target: test
54-
repo_name: test
55-
url_prefix: test-
56-
secrets: inherit
57-
call-workflow-dev:
58-
if: ${{ github.ref == 'refs/heads/dev' || (github.event_name == 'pull_request' && github.base_ref == 'dev' && github.event.pull_request.draft == false) }}
59-
uses: hwinther/test/.github/workflows/playwright.yml@dev
6053
with:
6154
deploy_target: dev
6255
repo_name: dev

0 commit comments

Comments
 (0)