-
Notifications
You must be signed in to change notification settings - Fork 3
113 lines (99 loc) · 4.61 KB
/
build.yml
File metadata and controls
113 lines (99 loc) · 4.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
name: Build Project
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'pnpm'
- name: Set Node.js optimization environment variables
run: |
echo "TS_NODE_TRANSPILE_ONLY=true" >> $GITHUB_ENV
echo "TS_NODE_FILES=false" >> $GITHUB_ENV
- name: Cache dependencies
uses: actions/cache@v4
with:
path: |
~/.pnpm-store
${{ github.workspace }}/node_modules
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-
- name: Cache TypeScript build info
uses: actions/cache@v4
with:
path: |
${{ github.workspace }}/.tsbuildinfo
key: ${{ runner.os }}-ts-${{ hashFiles('**/tsconfig*.json') }}-${{ hashFiles('**/*.ts', '**/*.tsx') }}
restore-keys: |
${{ runner.os }}-ts-${{ hashFiles('**/tsconfig*.json') }}-
${{ runner.os }}-ts-
- name: Cache Next.js build
uses: actions/cache@v4
with:
path: |
${{ github.workspace }}/.next/cache
key: ${{ runner.os }}-next-${{ hashFiles('**/next.config.*', '**/package.json') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}
restore-keys: |
${{ runner.os }}-next-${{ hashFiles('**/next.config.*', '**/package.json') }}-
${{ runner.os }}-next-
- name: Create dummy amplify_outputs.json
run: |
echo '{
"auth": {
"user_pool_id": "dummy_user_pool_id",
"aws_region": "us-east-2",
"user_pool_client_id": "dummy_client_id"
},
"data": {
"url": "dummy_url",
"aws_region": "us-east-2",
"api_key": "dummy_api_key"
},
"version": "1.0",
"custom": {
"APIs": {
"SubscriptionApi": {"endpoint": "dummy_endpoint", "region": "dummy_region", "apiName": "SubscriptionApi", "stage": "dev"},
"WebHookApi": {"endpoint": "dummy_endpoint", "region": "dummy_region", "apiName": "WebHookApi", "stage": "dev"},
"CheckStoreNameApi": {"endpoint": "dummy_endpoint", "region": "dummy_region", "apiName": "CheckStoreNameApi", "stage": "dev"},
"CheckStoreDomainApi": {"endpoint": "dummy_endpoint", "region": "dummy_region", "apiName": "CheckStoreDomain", "stage": "dev"},
"ApiKeyManagerApi": {"endpoint": "dummy_endpoint", "region": "dummy_region", "apiName": "ApiKeyManagerApi", "stage": "dev"},
"GetStoreProductsApi": {"endpoint": "dummy_endpoint", "region": "dummy_region", "apiName": "GetStoreProductsApi", "stage": "dev"},
"GetStoreDataApi": {"endpoint": "dummy_endpoint", "region": "dummy_region", "apiName": "GetStoreDataApi", "stage": "dev"},
"StoreImagesApi": {"endpoint": "dummy_endpoint", "region": "dummy_region", "apiName": "StoreImagesApi", "stage": "dev"},
"BulkEmailApi": {"endpoint": "dummy_endpoint", "region": "dummy_region", "apiName": "BulkEmailApi", "stage": "dev"},
"StoreLimitsApi": {"endpoint": "dummy_endpoint", "region": "dummy_region", "apiName": "StoreLimitsApi", "stage": "dev"},
"GetStoreCollectionsApi": {"endpoint": "dummy_endpoint", "region": "dummy_region", "apiName": "GetStoreCollectionsApi", "stage": "dev"},
"WebSocketDevServerApi": {"endpoint": "wss://dummy.execute-api.us-east-2.amazonaws.com/dev", "managementEndpoint": "https://dummy.execute-api.us-east-2.amazonaws.com/dev", "region": "us-east-2", "apiId": "dummy", "stage": "dev"}
}
}
}' > amplify_outputs.json
- name: Create dummy .env file
run: |
echo 'CLOUDFLARE_API_TOKEN=dummy_cloudflare_api_token
CLOUDFLARE_ZONE_ID=dummy_cloudflare_zone_id' > .env
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Type check (separate)
run: |
echo "Running type check..."
time pnpm run type-check:fast
echo "Type check completed"
- name: Build project (fast)
run: |
echo "Running Next.js build (no type checking)..."
time pnpm run build:fast
echo "Build completed"