This repository was archived by the owner on Apr 28, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (79 loc) · 2.68 KB
/
deploy.yml
File metadata and controls
94 lines (79 loc) · 2.68 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
name: Deploy Documentation
on:
push:
branches: [main]
workflow_dispatch: # Allow manual deployment
jobs:
deploy:
name: Build and Deploy
runs-on: ubuntu-latest
steps:
- name: Checkout docs
uses: actions/checkout@v4
- name: Checkout corpus (for schema and contracts)
uses: actions/checkout@v4
with:
repository: behavioral-contracts/corpus
path: ../corpus
- name: Checkout verify-cli (for help output)
uses: actions/checkout@v4
with:
repository: behavioral-contracts/verify-cli
path: ../verify-cli
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'
- name: Install docs dependencies
run: npm ci
- name: Install verify-cli dependencies and build
run: |
cd ../verify-cli
npm ci
npm run build
- name: Regenerate all auto-generated docs
run: npm run docs:generate
- name: Validate all examples
run: npm run validate
- name: Build documentation site
run: npm run build
env:
NODE_ENV: production
- name: Deploy to Vercel
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: '--prod'
working-directory: ./
# Alternative: Deploy to GitHub Pages
# - name: Deploy to GitHub Pages
# uses: peaceiris/actions-gh-pages@v3
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# publish_dir: ./build
# cname: docs.behavioral-contracts.org
# Alternative: Deploy to Netlify
# - name: Deploy to Netlify
# uses: nwtgck/actions-netlify@v2.0
# with:
# publish-dir: './build'
# production-branch: main
# github-token: ${{ secrets.GITHUB_TOKEN }}
# deploy-message: "Deploy from GitHub Actions"
# env:
# NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
# NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
- name: Comment on PR (if applicable)
if: github.event_name == 'pull_request'
uses: actions/github-script@v6
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '✅ Documentation deployed successfully!\n\nPreview: https://behavioral-contracts.org'
})