cistack 6.0.0 → 6.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/dependabot.yml +42 -0
- package/.github/workflows/ci.yml +2 -1
- package/.github/workflows/pipeline.yml +250 -0
- package/README.md +4 -0
- package/package.json +7 -2
- package/product-site/.github/dependabot.yml +27 -0
- package/product-site/.github/workflows/pipeline.yml +215 -0
- package/product-site/.lighthouserc.json +22 -0
- package/product-site/README.md +1 -0
- package/product-site/app/[lang]/layout.tsx +95 -0
- package/product-site/app/[lang]/page.tsx +19 -0
- package/product-site/app/favicon.ico +0 -0
- package/product-site/app/globals.css +228 -0
- package/product-site/app/manifest.ts +20 -0
- package/product-site/app/robots.ts +12 -0
- package/product-site/app/sitemap.ts +12 -0
- package/product-site/components/CanvasText.tsx +219 -0
- package/product-site/components/CopyButton.tsx +101 -0
- package/product-site/components/HomeClient.tsx +664 -0
- package/product-site/components/InstallToggle.tsx +123 -0
- package/product-site/components/MotionRevealClient.tsx +53 -0
- package/product-site/components/TerminalCard.tsx +65 -0
- package/product-site/components/TerminalCardMotion.tsx +324 -0
- package/product-site/components/site-motion.tsx +229 -0
- package/product-site/components/ui/accordion.tsx +74 -0
- package/product-site/components/ui/badge.tsx +52 -0
- package/product-site/components/ui/button.tsx +60 -0
- package/product-site/components/ui/card.tsx +103 -0
- package/product-site/components/ui/checkbox.tsx +29 -0
- package/product-site/components/ui/separator.tsx +25 -0
- package/product-site/components/ui/table.tsx +116 -0
- package/product-site/components/ui/tabs.tsx +82 -0
- package/product-site/components.json +25 -0
- package/product-site/dictionaries/br.json +276 -0
- package/product-site/dictionaries/cn.json +276 -0
- package/product-site/dictionaries/de.json +276 -0
- package/product-site/dictionaries/en.json +274 -0
- package/product-site/dictionaries/es.json +276 -0
- package/product-site/dictionaries/fr.json +276 -0
- package/product-site/dictionaries/pt.json +276 -0
- package/product-site/eslint.config.mjs +18 -0
- package/product-site/lib/dictionaries.ts +18 -0
- package/product-site/lib/dictionary-types.ts +3 -0
- package/product-site/lib/utils.ts +6 -0
- package/product-site/middleware.ts +39 -0
- package/product-site/next.config.mjs +14 -0
- package/product-site/package-lock.json +14201 -0
- package/product-site/package.json +42 -0
- package/product-site/postcss.config.mjs +7 -0
- package/product-site/public/file.svg +1 -0
- package/product-site/public/globe.svg +1 -0
- package/product-site/public/next.svg +1 -0
- package/product-site/public/og-image.png +0 -0
- package/product-site/public/vercel.svg +1 -0
- package/product-site/public/window.svg +1 -0
- package/product-site/scripts/sync-i18n.mjs +58 -0
- package/product-site/scripts/validate-i18n.mjs +45 -0
- package/product-site/tsconfig.json +34 -0
- package/product-site/types/negotiator.d.ts +14 -0
- package/product-site/vercel.json +5 -0
- package/src/index.js +12 -13
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Generated by cistack — https://github.com/cistack
|
|
2
|
+
# Dependabot configuration — auto-update dependencies weekly
|
|
3
|
+
|
|
4
|
+
version: 2
|
|
5
|
+
|
|
6
|
+
updates:
|
|
7
|
+
- package-ecosystem: npm
|
|
8
|
+
directory: /
|
|
9
|
+
schedule:
|
|
10
|
+
interval: weekly
|
|
11
|
+
day: monday
|
|
12
|
+
open-pull-requests-limit: 10
|
|
13
|
+
groups:
|
|
14
|
+
root-dev-dependencies:
|
|
15
|
+
dependency-type: development
|
|
16
|
+
update-types:
|
|
17
|
+
- minor
|
|
18
|
+
- patch
|
|
19
|
+
|
|
20
|
+
- package-ecosystem: npm
|
|
21
|
+
directory: /product-site
|
|
22
|
+
schedule:
|
|
23
|
+
interval: weekly
|
|
24
|
+
day: monday
|
|
25
|
+
open-pull-requests-limit: 10
|
|
26
|
+
groups:
|
|
27
|
+
product-site-dev-dependencies:
|
|
28
|
+
dependency-type: development
|
|
29
|
+
update-types:
|
|
30
|
+
- minor
|
|
31
|
+
- patch
|
|
32
|
+
|
|
33
|
+
- package-ecosystem: github-actions
|
|
34
|
+
directory: /
|
|
35
|
+
schedule:
|
|
36
|
+
interval: weekly
|
|
37
|
+
day: monday
|
|
38
|
+
open-pull-requests-limit: 10
|
|
39
|
+
groups:
|
|
40
|
+
github-actions-updates:
|
|
41
|
+
patterns:
|
|
42
|
+
- '*'
|
package/.github/workflows/ci.yml
CHANGED
|
@@ -13,7 +13,7 @@ concurrency:
|
|
|
13
13
|
|
|
14
14
|
jobs:
|
|
15
15
|
test:
|
|
16
|
-
name: Node ${{ matrix.node-version }}
|
|
16
|
+
name: CLI · Node ${{ matrix.node-version }}
|
|
17
17
|
runs-on: ubuntu-latest
|
|
18
18
|
strategy:
|
|
19
19
|
fail-fast: false
|
|
@@ -32,6 +32,7 @@ jobs:
|
|
|
32
32
|
with:
|
|
33
33
|
node-version: ${{ matrix.node-version }}
|
|
34
34
|
cache: npm
|
|
35
|
+
cache-dependency-path: package-lock.json
|
|
35
36
|
|
|
36
37
|
- name: Install dependencies
|
|
37
38
|
run: npm ci
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
# Generated by cistack v6.0.0 — https://github.com/cistack
|
|
2
|
+
# Unified Pipeline: ci, deploy
|
|
3
|
+
# Required secrets: VERCEL_TOKEN, VERCEL_ORG_ID, VERCEL_PROJECT_ID
|
|
4
|
+
# Add these at: Settings → Secrets and Variables → Actions
|
|
5
|
+
# Dependabot remains in .github/dependabot.yml
|
|
6
|
+
|
|
7
|
+
name: Pipeline
|
|
8
|
+
|
|
9
|
+
'on':
|
|
10
|
+
push:
|
|
11
|
+
branches:
|
|
12
|
+
- main
|
|
13
|
+
pull_request:
|
|
14
|
+
branches:
|
|
15
|
+
- main
|
|
16
|
+
workflow_dispatch: {}
|
|
17
|
+
|
|
18
|
+
concurrency:
|
|
19
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
20
|
+
cancel-in-progress: true
|
|
21
|
+
|
|
22
|
+
jobs:
|
|
23
|
+
ci_lint:
|
|
24
|
+
name: 🔍 Lint & Format
|
|
25
|
+
runs-on: ubuntu-latest
|
|
26
|
+
if: >-
|
|
27
|
+
(github.event_name == 'push' && (github.ref_name == 'main')) || (github.event_name == 'pull_request' &&
|
|
28
|
+
(github.base_ref == 'main'))
|
|
29
|
+
env:
|
|
30
|
+
CI: 'true'
|
|
31
|
+
steps:
|
|
32
|
+
- name: Checkout code
|
|
33
|
+
uses: actions/checkout@v4
|
|
34
|
+
with:
|
|
35
|
+
fetch-depth: 0
|
|
36
|
+
|
|
37
|
+
- name: Set up Node.js
|
|
38
|
+
uses: actions/setup-node@v4
|
|
39
|
+
with:
|
|
40
|
+
node-version: '20'
|
|
41
|
+
cache: npm
|
|
42
|
+
cache-dependency-path: product-site/package-lock.json
|
|
43
|
+
|
|
44
|
+
- name: Install dependencies
|
|
45
|
+
working-directory: product-site
|
|
46
|
+
run: npm ci
|
|
47
|
+
|
|
48
|
+
- name: Lint
|
|
49
|
+
working-directory: product-site
|
|
50
|
+
run: npm run lint -- .
|
|
51
|
+
|
|
52
|
+
- name: Typecheck
|
|
53
|
+
working-directory: product-site
|
|
54
|
+
run: npm run typecheck
|
|
55
|
+
|
|
56
|
+
ci_build:
|
|
57
|
+
name: 🏗️ Build
|
|
58
|
+
runs-on: ubuntu-latest
|
|
59
|
+
needs:
|
|
60
|
+
- ci_lint
|
|
61
|
+
if: >-
|
|
62
|
+
(github.event_name == 'push' && (github.ref_name == 'main')) || (github.event_name == 'pull_request' &&
|
|
63
|
+
(github.base_ref == 'main'))
|
|
64
|
+
env:
|
|
65
|
+
NODE_ENV: production
|
|
66
|
+
steps:
|
|
67
|
+
- name: Checkout code
|
|
68
|
+
uses: actions/checkout@v4
|
|
69
|
+
with:
|
|
70
|
+
fetch-depth: 0
|
|
71
|
+
|
|
72
|
+
- name: Set up Node.js
|
|
73
|
+
uses: actions/setup-node@v4
|
|
74
|
+
with:
|
|
75
|
+
node-version: '20'
|
|
76
|
+
cache: npm
|
|
77
|
+
cache-dependency-path: product-site/package-lock.json
|
|
78
|
+
|
|
79
|
+
- name: Install dependencies
|
|
80
|
+
working-directory: product-site
|
|
81
|
+
run: npm ci
|
|
82
|
+
|
|
83
|
+
- name: Build
|
|
84
|
+
working-directory: product-site
|
|
85
|
+
run: npm run build:ci
|
|
86
|
+
env:
|
|
87
|
+
NODE_ENV: production
|
|
88
|
+
|
|
89
|
+
- name: Upload build artifact
|
|
90
|
+
uses: actions/upload-artifact@v4
|
|
91
|
+
with:
|
|
92
|
+
name: product-site-build-output
|
|
93
|
+
path: product-site/.next
|
|
94
|
+
retention-days: 1
|
|
95
|
+
|
|
96
|
+
deploy_deploy:
|
|
97
|
+
name: 🚀 Deploy → Vercel (Production)
|
|
98
|
+
runs-on: ubuntu-latest
|
|
99
|
+
environment: production
|
|
100
|
+
needs: [ci_build]
|
|
101
|
+
if: >-
|
|
102
|
+
((github.event_name == 'push' && (github.ref_name == 'main')) || (github.event_name == 'pull_request' &&
|
|
103
|
+
(github.base_ref == 'main')) || github.event_name == 'workflow_dispatch') && (github.event_name == 'push' ||
|
|
104
|
+
github.event_name == 'workflow_dispatch')
|
|
105
|
+
steps:
|
|
106
|
+
- name: Checkout code
|
|
107
|
+
uses: actions/checkout@v4
|
|
108
|
+
with:
|
|
109
|
+
fetch-depth: 0
|
|
110
|
+
|
|
111
|
+
- name: Set up Node.js
|
|
112
|
+
uses: actions/setup-node@v4
|
|
113
|
+
with:
|
|
114
|
+
node-version: '20'
|
|
115
|
+
cache: npm
|
|
116
|
+
cache-dependency-path: product-site/package-lock.json
|
|
117
|
+
|
|
118
|
+
- name: Install dependencies
|
|
119
|
+
working-directory: product-site
|
|
120
|
+
run: npm ci
|
|
121
|
+
|
|
122
|
+
- name: Install Vercel CLI
|
|
123
|
+
run: npm install -g vercel
|
|
124
|
+
|
|
125
|
+
- name: Validate Vercel credentials
|
|
126
|
+
run: >-
|
|
127
|
+
test -n "$VERCEL_TOKEN" || (echo "Missing VERCEL_TOKEN secret. Add it in GitHub Actions secrets, or Dependabot
|
|
128
|
+
secrets for Dependabot PRs." && exit 1)
|
|
129
|
+
|
|
130
|
+
test -n "$VERCEL_ORG_ID" || (echo "Missing VERCEL_ORG_ID secret. Add it in GitHub Actions secrets, or
|
|
131
|
+
Dependabot secrets for Dependabot PRs." && exit 1)
|
|
132
|
+
|
|
133
|
+
test -n "$VERCEL_PROJECT_ID" || (echo "Missing VERCEL_PROJECT_ID secret. Add it in GitHub Actions secrets, or
|
|
134
|
+
Dependabot secrets for Dependabot PRs." && exit 1)
|
|
135
|
+
env:
|
|
136
|
+
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
|
|
137
|
+
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
|
|
138
|
+
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
|
|
139
|
+
|
|
140
|
+
- name: Pull Vercel environment
|
|
141
|
+
working-directory: product-site
|
|
142
|
+
run: vercel pull --yes --environment=production --token="$VERCEL_TOKEN"
|
|
143
|
+
env:
|
|
144
|
+
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
|
|
145
|
+
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
|
|
146
|
+
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
|
|
147
|
+
|
|
148
|
+
- name: Build project
|
|
149
|
+
working-directory: product-site
|
|
150
|
+
run: vercel build --prod --token="$VERCEL_TOKEN"
|
|
151
|
+
env:
|
|
152
|
+
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
|
|
153
|
+
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
|
|
154
|
+
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
|
|
155
|
+
|
|
156
|
+
- name: Deploy to Vercel
|
|
157
|
+
id: deploy
|
|
158
|
+
working-directory: product-site
|
|
159
|
+
run: >-
|
|
160
|
+
vercel deploy --prebuilt --prod --token="$VERCEL_TOKEN" > deployment_url.txt && echo "DEPLOYMENT_URL=$(cat
|
|
161
|
+
deployment_url.txt)" >> $GITHUB_ENV
|
|
162
|
+
env:
|
|
163
|
+
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
|
|
164
|
+
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
|
|
165
|
+
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
|
|
166
|
+
|
|
167
|
+
deploy_preview:
|
|
168
|
+
name: ✨ Deploy → Vercel (Preview)
|
|
169
|
+
runs-on: ubuntu-latest
|
|
170
|
+
environment: preview
|
|
171
|
+
needs: [ci_build]
|
|
172
|
+
if: >-
|
|
173
|
+
((github.event_name == 'push' && (github.ref_name == 'main')) || (github.event_name == 'pull_request' &&
|
|
174
|
+
(github.base_ref == 'main')) || github.event_name == 'workflow_dispatch') && (github.event_name == 'pull_request'
|
|
175
|
+
&& github.event.pull_request.head.repo.full_name == github.repository)
|
|
176
|
+
steps:
|
|
177
|
+
- name: Checkout code
|
|
178
|
+
uses: actions/checkout@v4
|
|
179
|
+
with:
|
|
180
|
+
fetch-depth: 0
|
|
181
|
+
|
|
182
|
+
- name: Set up Node.js
|
|
183
|
+
uses: actions/setup-node@v4
|
|
184
|
+
with:
|
|
185
|
+
node-version: '20'
|
|
186
|
+
cache: npm
|
|
187
|
+
cache-dependency-path: product-site/package-lock.json
|
|
188
|
+
|
|
189
|
+
- name: Install dependencies
|
|
190
|
+
working-directory: product-site
|
|
191
|
+
run: npm ci
|
|
192
|
+
|
|
193
|
+
- name: Install Vercel CLI
|
|
194
|
+
run: npm install -g vercel
|
|
195
|
+
|
|
196
|
+
- name: Validate Vercel credentials
|
|
197
|
+
run: >-
|
|
198
|
+
test -n "$VERCEL_TOKEN" || (echo "Missing VERCEL_TOKEN secret. Add it in GitHub Actions secrets, or Dependabot
|
|
199
|
+
secrets for Dependabot PRs." && exit 1)
|
|
200
|
+
|
|
201
|
+
test -n "$VERCEL_ORG_ID" || (echo "Missing VERCEL_ORG_ID secret. Add it in GitHub Actions secrets, or
|
|
202
|
+
Dependabot secrets for Dependabot PRs." && exit 1)
|
|
203
|
+
|
|
204
|
+
test -n "$VERCEL_PROJECT_ID" || (echo "Missing VERCEL_PROJECT_ID secret. Add it in GitHub Actions secrets, or
|
|
205
|
+
Dependabot secrets for Dependabot PRs." && exit 1)
|
|
206
|
+
env:
|
|
207
|
+
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
|
|
208
|
+
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
|
|
209
|
+
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
|
|
210
|
+
|
|
211
|
+
- name: Pull Vercel environment
|
|
212
|
+
working-directory: product-site
|
|
213
|
+
run: vercel pull --yes --environment=preview --token="$VERCEL_TOKEN"
|
|
214
|
+
env:
|
|
215
|
+
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
|
|
216
|
+
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
|
|
217
|
+
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
|
|
218
|
+
|
|
219
|
+
- name: Build project
|
|
220
|
+
working-directory: product-site
|
|
221
|
+
run: vercel build --token="$VERCEL_TOKEN"
|
|
222
|
+
env:
|
|
223
|
+
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
|
|
224
|
+
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
|
|
225
|
+
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
|
|
226
|
+
|
|
227
|
+
- name: Deploy to Vercel
|
|
228
|
+
id: deploy
|
|
229
|
+
working-directory: product-site
|
|
230
|
+
run: >-
|
|
231
|
+
vercel deploy --prebuilt --token="$VERCEL_TOKEN" > deployment_url.txt && echo "DEPLOYMENT_URL=$(cat
|
|
232
|
+
deployment_url.txt)" >> $GITHUB_ENV
|
|
233
|
+
env:
|
|
234
|
+
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
|
|
235
|
+
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
|
|
236
|
+
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
|
|
237
|
+
|
|
238
|
+
- name: Comment PR
|
|
239
|
+
if: always() && github.actor != 'dependabot[bot]'
|
|
240
|
+
uses: actions/github-script@v7
|
|
241
|
+
with:
|
|
242
|
+
script: |-
|
|
243
|
+
const deploymentUrl = process.env.DEPLOYMENT_URL;
|
|
244
|
+
if (!deploymentUrl) return;
|
|
245
|
+
github.rest.issues.createComment({
|
|
246
|
+
issue_number: context.issue.number,
|
|
247
|
+
owner: context.repo.owner,
|
|
248
|
+
repo: context.repo.repo,
|
|
249
|
+
body: '🚀 **Deployment Preview Ready!**\n\n[View Preview](' + deploymentUrl + ')'
|
|
250
|
+
});
|
package/README.md
CHANGED
|
@@ -28,6 +28,10 @@ npm install -g cistack
|
|
|
28
28
|
|
|
29
29
|
`cistack` supports Node.js 16+, and the project itself is continuously verified on Node.js 18, 20, and 22 in GitHub Actions.
|
|
30
30
|
|
|
31
|
+
## Product site
|
|
32
|
+
|
|
33
|
+
A standalone Next.js marketing app for the product lives in [product-site](/Users/edwinvs/Desktop/NPM/ciflow/product-site/README.md).
|
|
34
|
+
|
|
31
35
|
## CLI Usage
|
|
32
36
|
|
|
33
37
|
### Generate workflows
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cistack",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.2.0",
|
|
4
4
|
"description": "Automatically generate GitHub Actions CI/CD pipelines by analysing your codebase",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -10,7 +10,12 @@
|
|
|
10
10
|
"scripts": {
|
|
11
11
|
"start": "node bin/ciflow.js",
|
|
12
12
|
"test": "node tests/run.js",
|
|
13
|
-
"test:smoke": "node bin/ciflow.js generate --path . --dry-run --no-prompt"
|
|
13
|
+
"test:smoke": "node bin/ciflow.js generate --path . --dry-run --no-prompt",
|
|
14
|
+
"site:dev": "npm --prefix product-site run dev",
|
|
15
|
+
"site:build": "npm --prefix product-site run build:ci",
|
|
16
|
+
"site:start": "npm --prefix product-site run start",
|
|
17
|
+
"site:lint": "npm --prefix product-site run lint -- .",
|
|
18
|
+
"site:typecheck": "npm --prefix product-site run typecheck"
|
|
14
19
|
},
|
|
15
20
|
"keywords": [
|
|
16
21
|
"github-actions",
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Generated by cistack — https://github.com/cistack
|
|
2
|
+
# Dependabot configuration — auto-update dependencies weekly
|
|
3
|
+
|
|
4
|
+
version: 2
|
|
5
|
+
updates:
|
|
6
|
+
- package-ecosystem: npm
|
|
7
|
+
directory: /
|
|
8
|
+
schedule:
|
|
9
|
+
interval: weekly
|
|
10
|
+
day: monday
|
|
11
|
+
open-pull-requests-limit: 10
|
|
12
|
+
groups:
|
|
13
|
+
dev-dependencies:
|
|
14
|
+
dependency-type: development
|
|
15
|
+
update-types:
|
|
16
|
+
- minor
|
|
17
|
+
- patch
|
|
18
|
+
- package-ecosystem: github-actions
|
|
19
|
+
directory: /
|
|
20
|
+
schedule:
|
|
21
|
+
interval: weekly
|
|
22
|
+
day: monday
|
|
23
|
+
open-pull-requests-limit: 10
|
|
24
|
+
groups:
|
|
25
|
+
github-actions-updates:
|
|
26
|
+
patterns:
|
|
27
|
+
- '*'
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
# Generated by cistack v6.0.0 — https://github.com/cistack
|
|
2
|
+
# Unified Pipeline: ci, deploy
|
|
3
|
+
# CI: locale JSON files are checked for key parity vs en.json (scripts/validate-i18n.mjs, no install).
|
|
4
|
+
# Required secrets: VERCEL_TOKEN, VERCEL_ORG_ID, VERCEL_PROJECT_ID
|
|
5
|
+
# Add these at: Settings → Secrets and Variables → Actions
|
|
6
|
+
# Dependabot remains in .github/dependabot.yml
|
|
7
|
+
|
|
8
|
+
name: CISTACK PIPELINE
|
|
9
|
+
'on':
|
|
10
|
+
push:
|
|
11
|
+
branches:
|
|
12
|
+
- main
|
|
13
|
+
pull_request:
|
|
14
|
+
branches:
|
|
15
|
+
- main
|
|
16
|
+
workflow_dispatch: {}
|
|
17
|
+
concurrency:
|
|
18
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
19
|
+
cancel-in-progress: true
|
|
20
|
+
jobs:
|
|
21
|
+
ci_i18n:
|
|
22
|
+
name: 🌐 Locale strings
|
|
23
|
+
runs-on: ubuntu-latest
|
|
24
|
+
steps:
|
|
25
|
+
- name: Checkout code
|
|
26
|
+
uses: actions/checkout@v4
|
|
27
|
+
- name: Validate dictionary key parity
|
|
28
|
+
run: node scripts/validate-i18n.mjs
|
|
29
|
+
if: >-
|
|
30
|
+
(github.event_name == 'push' && (github.ref_name == 'main')) || (github.event_name == 'pull_request' &&
|
|
31
|
+
(github.base_ref == 'main'))
|
|
32
|
+
ci_lint:
|
|
33
|
+
name: 🔍 Lint & Format
|
|
34
|
+
runs-on: ubuntu-latest
|
|
35
|
+
steps:
|
|
36
|
+
- name: Checkout code
|
|
37
|
+
uses: actions/checkout@v4
|
|
38
|
+
with:
|
|
39
|
+
fetch-depth: 0
|
|
40
|
+
- name: Set up Node.js
|
|
41
|
+
uses: actions/setup-node@v4
|
|
42
|
+
with:
|
|
43
|
+
node-version: '20'
|
|
44
|
+
cache: npm
|
|
45
|
+
- name: Install dependencies
|
|
46
|
+
run: npm ci
|
|
47
|
+
- name: Lint
|
|
48
|
+
run: npm run lint
|
|
49
|
+
env:
|
|
50
|
+
CI: 'true'
|
|
51
|
+
if: >-
|
|
52
|
+
(github.event_name == 'push' && (github.ref_name == 'main')) || (github.event_name == 'pull_request' &&
|
|
53
|
+
(github.base_ref == 'main'))
|
|
54
|
+
ci_build:
|
|
55
|
+
name: 🏗️ Build
|
|
56
|
+
runs-on: ubuntu-latest
|
|
57
|
+
needs:
|
|
58
|
+
- ci_lint
|
|
59
|
+
- ci_i18n
|
|
60
|
+
steps:
|
|
61
|
+
- name: Checkout code
|
|
62
|
+
uses: actions/checkout@v4
|
|
63
|
+
with:
|
|
64
|
+
fetch-depth: 0
|
|
65
|
+
- name: Set up Node.js
|
|
66
|
+
uses: actions/setup-node@v4
|
|
67
|
+
with:
|
|
68
|
+
node-version: '20'
|
|
69
|
+
cache: npm
|
|
70
|
+
- name: Install dependencies
|
|
71
|
+
run: npm ci
|
|
72
|
+
- name: Build
|
|
73
|
+
run: npm run build
|
|
74
|
+
env:
|
|
75
|
+
NODE_ENV: production
|
|
76
|
+
- name: Upload build artifact
|
|
77
|
+
uses: actions/upload-artifact@v4
|
|
78
|
+
with:
|
|
79
|
+
name: build-output
|
|
80
|
+
path: .next
|
|
81
|
+
retention-days: 1
|
|
82
|
+
env:
|
|
83
|
+
NODE_ENV: production
|
|
84
|
+
if: >-
|
|
85
|
+
(github.event_name == 'push' && (github.ref_name == 'main')) || (github.event_name == 'pull_request' &&
|
|
86
|
+
(github.base_ref == 'main'))
|
|
87
|
+
deploy_deploy:
|
|
88
|
+
name: 🚀 Deploy → Vercel (Production)
|
|
89
|
+
if: >-
|
|
90
|
+
((github.event_name == 'push' && (github.ref_name == 'main')) || (github.event_name == 'pull_request' &&
|
|
91
|
+
(github.base_ref == 'main')) || github.event_name == 'workflow_dispatch') && (github.event_name == 'push' ||
|
|
92
|
+
github.event_name == 'workflow_dispatch')
|
|
93
|
+
runs-on: ubuntu-latest
|
|
94
|
+
environment: production
|
|
95
|
+
steps:
|
|
96
|
+
- name: Checkout code
|
|
97
|
+
uses: actions/checkout@v4
|
|
98
|
+
with:
|
|
99
|
+
fetch-depth: 0
|
|
100
|
+
- name: Set up Node.js
|
|
101
|
+
uses: actions/setup-node@v4
|
|
102
|
+
with:
|
|
103
|
+
node-version: '20'
|
|
104
|
+
cache: npm
|
|
105
|
+
- name: Install dependencies
|
|
106
|
+
run: npm ci
|
|
107
|
+
- name: Install Vercel CLI
|
|
108
|
+
run: npm install -g vercel
|
|
109
|
+
- name: Validate Vercel credentials
|
|
110
|
+
run: >-
|
|
111
|
+
test -n "$VERCEL_TOKEN" || (echo "Missing VERCEL_TOKEN secret. Add it in GitHub Actions secrets, or Dependabot
|
|
112
|
+
secrets for Dependabot PRs." && exit 1)
|
|
113
|
+
|
|
114
|
+
test -n "$VERCEL_ORG_ID" || (echo "Missing VERCEL_ORG_ID secret. Add it in GitHub Actions secrets, or
|
|
115
|
+
Dependabot secrets for Dependabot PRs." && exit 1)
|
|
116
|
+
|
|
117
|
+
test -n "$VERCEL_PROJECT_ID" || (echo "Missing VERCEL_PROJECT_ID secret. Add it in GitHub Actions secrets, or
|
|
118
|
+
Dependabot secrets for Dependabot PRs." && exit 1)
|
|
119
|
+
env:
|
|
120
|
+
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
|
|
121
|
+
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
|
|
122
|
+
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
|
|
123
|
+
- name: Pull Vercel environment
|
|
124
|
+
run: vercel pull --yes --environment=production --token="$VERCEL_TOKEN"
|
|
125
|
+
env:
|
|
126
|
+
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
|
|
127
|
+
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
|
|
128
|
+
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
|
|
129
|
+
- name: Build project
|
|
130
|
+
run: vercel build --prod --token="$VERCEL_TOKEN"
|
|
131
|
+
env:
|
|
132
|
+
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
|
|
133
|
+
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
|
|
134
|
+
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
|
|
135
|
+
- name: Deploy to Vercel
|
|
136
|
+
id: deploy
|
|
137
|
+
run: >-
|
|
138
|
+
vercel deploy --prebuilt --prod --token="$VERCEL_TOKEN" > deployment_url.txt && echo "DEPLOYMENT_URL=$(cat
|
|
139
|
+
deployment_url.txt)" >> $GITHUB_ENV
|
|
140
|
+
env:
|
|
141
|
+
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
|
|
142
|
+
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
|
|
143
|
+
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
|
|
144
|
+
deploy_preview:
|
|
145
|
+
name: ✨ Deploy → Vercel (Preview)
|
|
146
|
+
if: >-
|
|
147
|
+
((github.event_name == 'push' && (github.ref_name == 'main')) || (github.event_name == 'pull_request' &&
|
|
148
|
+
(github.base_ref == 'main')) || github.event_name == 'workflow_dispatch') && (github.event_name == 'pull_request'
|
|
149
|
+
&& github.event.pull_request.head.repo.full_name == github.repository)
|
|
150
|
+
runs-on: ubuntu-latest
|
|
151
|
+
environment: preview
|
|
152
|
+
steps:
|
|
153
|
+
- name: Checkout code
|
|
154
|
+
uses: actions/checkout@v4
|
|
155
|
+
with:
|
|
156
|
+
fetch-depth: 0
|
|
157
|
+
- name: Set up Node.js
|
|
158
|
+
uses: actions/setup-node@v4
|
|
159
|
+
with:
|
|
160
|
+
node-version: '20'
|
|
161
|
+
cache: npm
|
|
162
|
+
- name: Install dependencies
|
|
163
|
+
run: npm ci
|
|
164
|
+
- name: Install Vercel CLI
|
|
165
|
+
run: npm install -g vercel
|
|
166
|
+
- name: Validate Vercel credentials
|
|
167
|
+
run: >-
|
|
168
|
+
test -n "$VERCEL_TOKEN" || (echo "Missing VERCEL_TOKEN secret. Add it in GitHub Actions secrets, or Dependabot
|
|
169
|
+
secrets for Dependabot PRs." && exit 1)
|
|
170
|
+
|
|
171
|
+
test -n "$VERCEL_ORG_ID" || (echo "Missing VERCEL_ORG_ID secret. Add it in GitHub Actions secrets, or
|
|
172
|
+
Dependabot secrets for Dependabot PRs." && exit 1)
|
|
173
|
+
|
|
174
|
+
test -n "$VERCEL_PROJECT_ID" || (echo "Missing VERCEL_PROJECT_ID secret. Add it in GitHub Actions secrets, or
|
|
175
|
+
Dependabot secrets for Dependabot PRs." && exit 1)
|
|
176
|
+
env:
|
|
177
|
+
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
|
|
178
|
+
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
|
|
179
|
+
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
|
|
180
|
+
- name: Pull Vercel environment
|
|
181
|
+
run: vercel pull --yes --environment=preview --token="$VERCEL_TOKEN"
|
|
182
|
+
env:
|
|
183
|
+
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
|
|
184
|
+
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
|
|
185
|
+
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
|
|
186
|
+
- name: Build project
|
|
187
|
+
run: vercel build --token="$VERCEL_TOKEN"
|
|
188
|
+
env:
|
|
189
|
+
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
|
|
190
|
+
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
|
|
191
|
+
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
|
|
192
|
+
- name: Deploy to Vercel
|
|
193
|
+
id: deploy
|
|
194
|
+
run: >-
|
|
195
|
+
vercel deploy --prebuilt --token="$VERCEL_TOKEN" > deployment_url.txt && echo "DEPLOYMENT_URL=$(cat
|
|
196
|
+
deployment_url.txt)" >> $GITHUB_ENV
|
|
197
|
+
env:
|
|
198
|
+
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
|
|
199
|
+
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
|
|
200
|
+
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
|
|
201
|
+
- name: Comment PR
|
|
202
|
+
if: always() && github.actor != 'dependabot[bot]'
|
|
203
|
+
uses: actions/github-script@v7
|
|
204
|
+
with:
|
|
205
|
+
script: |2-
|
|
206
|
+
|
|
207
|
+
const deploymentUrl = process.env.DEPLOYMENT_URL;
|
|
208
|
+
if (!deploymentUrl) return;
|
|
209
|
+
github.rest.issues.createComment({
|
|
210
|
+
issue_number: context.issue.number,
|
|
211
|
+
owner: context.repo.owner,
|
|
212
|
+
repo: context.repo.repo,
|
|
213
|
+
body: '🚀 **Deployment Preview Ready!**\n\n[View Preview](' + deploymentUrl + ')'
|
|
214
|
+
});
|
|
215
|
+
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"ci": {
|
|
3
|
+
"collect": {
|
|
4
|
+
"numberOfRuns": 1,
|
|
5
|
+
"startServerCommand": "npm run start",
|
|
6
|
+
"startServerReadyPattern": "Ready",
|
|
7
|
+
"startServerReadyTimeout": 120000,
|
|
8
|
+
"url": [
|
|
9
|
+
"http://localhost:3000/en"
|
|
10
|
+
]
|
|
11
|
+
},
|
|
12
|
+
"assert": {
|
|
13
|
+
"preset": "lighthouse:recommended",
|
|
14
|
+
"assertions": {
|
|
15
|
+
"forced-reflow-insight": "warn",
|
|
16
|
+
"legacy-javascript-insight": "warn",
|
|
17
|
+
"network-dependency-tree-insight": "warn",
|
|
18
|
+
"unused-javascript": "warn"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
For codebase of cistack project navigate to https://github.com/edwinvakayil/cistack
|