Skip to content

Commit f67f663

Browse files
authored
Merge pull request from develop
release(v0.2.0): promote preprod → production
2 parents 0f3defe + e867824 commit f67f663

File tree

88 files changed

+13857
-3237
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+13857
-3237
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @ayoub3bidi

.github/workflows/ci.yml

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,17 @@ jobs:
2626

2727
steps:
2828
- name: Checkout code
29-
uses: actions/checkout@v4
29+
uses: actions/checkout@v6
3030

3131
- name: Setup pnpm
3232
uses: pnpm/action-setup@v4
3333
with:
3434
version: 9
3535

3636
- name: Setup Node.js
37-
uses: actions/setup-node@v4
37+
uses: actions/setup-node@v6
3838
with:
39-
node-version: 20.x
39+
node-version: 24.11.1
4040
cache: 'pnpm'
4141

4242
- name: Install dependencies
@@ -63,15 +63,15 @@ jobs:
6363

6464
steps:
6565
- name: Checkout code
66-
uses: actions/checkout@v4
66+
uses: actions/checkout@v6
6767

6868
- name: Setup pnpm
6969
uses: pnpm/action-setup@v4
7070
with:
7171
version: 9
7272

7373
- name: Setup Node.js
74-
uses: actions/setup-node@v4
74+
uses: actions/setup-node@v6
7575
with:
7676
node-version: ${{ matrix.node-version }}
7777
cache: 'pnpm'
@@ -90,7 +90,7 @@ jobs:
9090

9191
- name: Upload coverage to Codecov
9292
if: matrix.node-version == '20.x'
93-
uses: codecov/codecov-action@v4
93+
uses: codecov/codecov-action@v5
9494
with:
9595
files: ./coverage/coverage-final.json
9696
flags: unittests
@@ -103,7 +103,7 @@ jobs:
103103

104104
- name: Comment coverage on PR
105105
if: github.event_name == 'pull_request' && matrix.node-version == '20.x'
106-
uses: romeovs/lcov-reporter-action@v0.3.1
106+
uses: romeovs/lcov-reporter-action@v0.4.0
107107
with:
108108
lcov-file: ./coverage/lcov.info
109109
github-token: ${{ secrets.GITHUB_TOKEN }}
@@ -118,27 +118,30 @@ jobs:
118118

119119
steps:
120120
- name: Checkout code
121-
uses: actions/checkout@v4
121+
uses: actions/checkout@v6
122122

123123
- name: Setup pnpm
124124
uses: pnpm/action-setup@v4
125125
with:
126126
version: 9
127127

128128
- name: Setup Node.js
129-
uses: actions/setup-node@v4
129+
uses: actions/setup-node@v6
130130
with:
131-
node-version: 20.x
131+
node-version: 24.11.1
132132
cache: 'pnpm'
133133

134134
- name: Install dependencies
135135
run: pnpm install --frozen-lockfile
136136

137137
- name: Build project
138138
run: pnpm build
139+
env:
140+
VITE_GIT_BRANCH: ${{ github.ref_name }}
141+
VITE_DEV_SITE_URL: 'https://dev-bayanflow.netlify.app'
139142

140143
- name: Upload build artifacts
141-
uses: actions/upload-artifact@v4
144+
uses: actions/upload-artifact@v5
142145
with:
143146
name: dist
144147
path: dist/
@@ -158,46 +161,52 @@ jobs:
158161

159162
steps:
160163
- name: Checkout code
161-
uses: actions/checkout@v4
164+
uses: actions/checkout@v6
162165

163166
- name: Setup pnpm
164167
uses: pnpm/action-setup@v4
165168
with:
166169
version: 9
167170

168171
- name: Setup Node.js
169-
uses: actions/setup-node@v4
172+
uses: actions/setup-node@v6
170173
with:
171-
node-version: 20.x
174+
node-version: 24.11.1
172175
cache: 'pnpm'
173176

174177
- name: Install dependencies
175178
run: pnpm install --frozen-lockfile
176179

177180
- name: Build project
178181
run: pnpm build
182+
env:
183+
# embed branch name into Vite build so the frontend can read it at runtime
184+
VITE_GIT_BRANCH: ${{ github.ref_name }}
185+
# optional: clickable dev site URL to use in the badge
186+
VITE_DEV_SITE_URL: 'https://dev-bayanflow.netlify.app'
179187

180188
- name: Deploy to Netlify
189+
id: netlify
181190
uses: nwtgck/actions-netlify@v3.0
182191
with:
183192
publish-dir: './dist'
184193
production-branch: main
185194
github-token: ${{ secrets.GITHUB_TOKEN }}
186-
deploy-message: "Deploy from GitHub Actions"
195+
deploy-message: "Deploy from GitHub Actions (${{ github.ref_name }})"
187196
enable-pull-request-comment: true
188197
enable-commit-comment: true
189198
overwrites-pull-request-comment: true
190199
github-deployment-environment: ${{ github.ref == 'refs/heads/main' && 'production' || github.ref == 'refs/heads/develop' && 'beta' || 'preview' }}
191-
alias: ${{ github.ref == 'refs/heads/develop' && 'beta' || '' }}
192200
env:
193201
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
194-
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
195-
timeout-minutes: 5
202+
# Use the dev site ID when building from develop, otherwise production site ID
203+
NETLIFY_SITE_ID: ${{ github.ref == 'refs/heads/develop' && secrets.NETLIFY_SITE_ID_DEV || secrets.NETLIFY_SITE_ID }}
204+
timeout-minutes: 10
196205

197206
- name: Output deployment URL
198207
if: always()
199208
run: |
200-
echo "Deployment completed!"
209+
echo "Netlify deploy URL: ${{ steps.netlify.outputs.deploy-url }}"
201210
202211
# Job 5: All checks passed (optional but useful for branch protection)
203212
all-checks-pass:
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: pr-source-enforcer
2+
3+
# Runs when a PR targets `main`
4+
on:
5+
pull_request:
6+
types: [opened, reopened, synchronize, edited]
7+
branches:
8+
- main
9+
10+
permissions:
11+
contents: read
12+
pull-requests: write
13+
14+
jobs:
15+
enforce_pr_source:
16+
runs-on: ubuntu-latest
17+
outputs:
18+
allowed: ${{ steps.check.outputs.allowed }}
19+
steps:
20+
- name: Set up shell
21+
run: echo "starting pr-source-enforcer"
22+
23+
- name: Read inputs
24+
id: check
25+
run: |
26+
# Allowed mergers come from a repo secret, comma-separated.
27+
# Set this secret in your repo settings: Settings -> Secrets -> Actions -> New repository secret
28+
# Example value: ayoub,my-org-release-bot
29+
ALLOWED="${{ secrets.ALLOWED_MERGERS }}"
30+
31+
# PR metadata from github context
32+
HEAD_REF="${{ github.event.pull_request.head.ref }}"
33+
PR_AUTHOR="${{ github.event.pull_request.user.login }}"
34+
TARGET_BRANCH="${{ github.event.pull_request.base.ref }}"
35+
36+
echo "HEAD_REF=$HEAD_REF"
37+
echo "PR_AUTHOR=$PR_AUTHOR"
38+
echo "TARGET_BRANCH=$TARGET_BRANCH"
39+
40+
# Normalize values (lowercase) for comparison
41+
head_lc="$(echo "$HEAD_REF" | tr '[:upper:]' '[:lower:]')"
42+
author_lc="$(echo "$PR_AUTHOR" | tr '[:upper:]' '[:lower:]')"
43+
allowed_lc="$(echo "$ALLOWED" | tr '[:upper:]' '[:lower:]')"
44+
45+
# Default to empty allowed list if secret missing
46+
if [ -z "$allowed_lc" ]; then
47+
echo "Warning: ALLOWED_MERGERS secret is empty or missing. No users will be allowed as bypassers."
48+
fi
49+
50+
# Check conditions: allowed if head is 'develop' OR author is in allowed list
51+
allowed="false"
52+
if [ "$head_lc" = "develop" ]; then
53+
allowed="true"
54+
else
55+
# iterate allowed list
56+
IFS=',' read -ra arr <<< "$allowed_lc"
57+
for u in "${arr[@]}"; do
58+
u_trim="$(echo "$u" | xargs)" # trim spaces
59+
if [ -n "$u_trim" ] && [ "$u_trim" = "$author_lc" ]; then
60+
allowed="true"
61+
break
62+
fi
63+
done
64+
fi
65+
66+
echo "allowed=$allowed"
67+
echo "::set-output name=allowed::$allowed"
68+
69+
- name: Fail if not allowed
70+
if: steps.check.outputs.allowed != 'true'
71+
run: |
72+
head_ref="${{ github.event.pull_request.head.ref }}"
73+
author="${{ github.event.pull_request.user.login }}"
74+
echo "ERROR: PR targeting 'main' is not allowed. Head branch is '$head_ref' and PR author is '$author'."
75+
echo "Only PRs whose head branch is 'develop' or PRs authored by an allowed merger (repo secret ALLOWED_MERGERS) may target 'main'."
76+
exit 1
77+
78+
- name: Success note
79+
if: steps.check.outputs.allowed == 'true'
80+
run: |
81+
echo "OK: PR allowed to target main (head branch is develop or author is allowed)."

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515

1616
steps:
1717
- name: Checkout code
18-
uses: actions/checkout@v4
18+
uses: actions/checkout@v6
1919
with:
2020
fetch-depth: 0 # Fetch all history for changelog generation
2121

@@ -25,9 +25,9 @@ jobs:
2525
version: 9
2626

2727
- name: Setup Node.js
28-
uses: actions/setup-node@v4
28+
uses: actions/setup-node@v6
2929
with:
30-
node-version: 20.x
30+
node-version: 24.11.1
3131
cache: 'pnpm'
3232

3333
- name: Install dependencies

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ dist-ssr
2222
*.njsproj
2323
*.sln
2424
*.sw?
25+
.tmp

CONTRIBUTING.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
Thank you for your interest in contributing to Bayan Flow! This document provides guidelines and information for contributors.
44

5+
> Notes:
6+
> - Create a PR that **ALWAYS** targets `develop` not `main`.
7+
> - All PRs must pass CI (lint, tests, build) before merge.
8+
59
## Table of Contents
610

711
- [Code of Conduct](#code-of-conduct)

0 commit comments

Comments
 (0)