-
-
Notifications
You must be signed in to change notification settings - Fork 1
72 lines (61 loc) · 1.88 KB
/
deploy-docs.yml
File metadata and controls
72 lines (61 loc) · 1.88 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
name: Deploy Website + Docs to GitHub Pages
on:
push:
branches:
- main
paths:
- 'apps/website/**'
- 'docs/**'
- '.github/workflows/deploy-docs.yml'
workflow_dispatch:
repository_dispatch:
types: [pages-health-failure]
permissions:
contents: write
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout main
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
# Build Website (Vite React SPA)
- name: Install apps/website dependencies
run: cd apps/website && npm install
- name: Build apps/website
run: cd apps/website && npm run build:ci
# Build Docsite (Docusaurus)
- name: Install docs dependencies
working-directory: docs
run: npm install
- name: Build docs
working-directory: docs
run: npm run build
# Combine builds
- name: Combine apps/website + docs
run: |
mkdir -p combined
cp -r apps/website/dist/* combined/
# Copy CNAME from public (if exists)
cp apps/website/public/CNAME combined/ 2>/dev/null || true
mkdir -p combined/docs
cp -r docs/build/* combined/docs/
touch combined/.nojekyll
# Deploy to gh-pages branch directly
- name: Deploy to gh-pages
run: |
cd combined
git init
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
git add .
git commit -m 'Deploy: ${{ github.event.head_commit.message }}'
git push --force https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/gHashTag/trinity.git HEAD:gh-pages