-
Notifications
You must be signed in to change notification settings - Fork 321
55 lines (46 loc) · 1.55 KB
/
Copy pathdeploy-staging.yml
File metadata and controls
55 lines (46 loc) · 1.55 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
name: Deploy to Staging
on:
push:
branches: [develop]
environment: staging
jobs:
deploy-staging:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build application
run: npm run build
env:
NEXT_PUBLIC_APP_ENV: staging
NEXT_PUBLIC_API_BASE_URL: ${{ secrets.STAGING_API_URL }}
NEXT_PUBLIC_STELLAR_NETWORK: testnet
NEXT_PUBLIC_STELLAR_HORIZON_URL: https://horizon-testnet.stellar.org
NEXT_PUBLIC_SOROBAN_RPC_URL: https://soroban-testnet.stellar.org
- name: Deploy to Vercel (Staging)
uses: amondnet/vercel-action@v25
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
vercel-args: '--env NEXT_PUBLIC_APP_ENV=staging'
- name: Comment PR with staging URL
if: github.event_name == 'pull_request'
uses: actions/github-script@v7
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '🚀 Staging deployment ready! Check it out at the Vercel preview URL.'
})