-
Notifications
You must be signed in to change notification settings - Fork 2
124 lines (106 loc) · 3.7 KB
/
Copy pathci.yml
File metadata and controls
124 lines (106 loc) · 3.7 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
114
115
116
117
118
119
120
121
122
123
124
name: CI / CD
on:
push:
branches:
- main
- 'copilot/**'
pull_request:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
# ────────────────────────────────────────────────────────────────
lint-and-type-check:
name: Lint & Type-check
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- name: Set up pnpm
uses: pnpm/action-setup@v4
- name: Set up Node 22
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Lint
run: pnpm run lint
- name: Type-check
run: pnpm exec tsc --noEmit
# ────────────────────────────────────────────────────────────────
build:
name: Production Build
runs-on: ubuntu-latest
needs: lint-and-type-check
permissions:
contents: read
env:
# Provide stub env vars so Next.js can build without real secrets
NEXT_PUBLIC_SUPABASE_URL: https://placeholder.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY: placeholder_anon_key
NEXT_PUBLIC_STELLAR_NETWORK: testnet
NEXT_PUBLIC_HORIZON_URL: https://horizon-testnet.stellar.org
steps:
- uses: actions/checkout@v4
- name: Set up pnpm
uses: pnpm/action-setup@v4
- name: Set up Node 22
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build
run: pnpm run build
- name: Upload build artefact
uses: actions/upload-artifact@v4
with:
name: next-build-${{ github.sha }}
path: .next/
retention-days: 7
# ────────────────────────────────────────────────────────────────
docker-build:
name: Docker Image Build
runs-on: ubuntu-latest
needs: build
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build Docker image (no push)
uses: docker/build-push-action@v6
with:
context: .
push: false
tags: agentforge:${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max
# ────────────────────────────────────────────────────────────────
# Optional: deploy to Vercel via Vercel CLI when pushing to main
# Uncomment and add VERCEL_TOKEN / VERCEL_ORG_ID / VERCEL_PROJECT_ID
# to repository secrets.
#
# deploy-preview:
# name: Deploy to Vercel
# runs-on: ubuntu-latest
# needs: build
# if: github.event_name == 'push' && github.ref == 'refs/heads/main'
# steps:
# - uses: actions/checkout@v4
# - uses: actions/setup-node@v4
# with:
# node-version: '22'
# cache: 'npm'
# - run: npm ci
# - run: npx vercel --prod --token=${{ secrets.VERCEL_TOKEN }}
# env:
# VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
# VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}