-
Notifications
You must be signed in to change notification settings - Fork 2
115 lines (96 loc) · 3.31 KB
/
Copy pathbuild-and-deploy.yml
File metadata and controls
115 lines (96 loc) · 3.31 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
name: Build and deploy
permissions:
contents: write
on:
push:
tags:
- 'v?[0-9]+.[0-9]+.[0-9]+'
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build core package
run: npm run build -w @eclipse-docks/core
# Root package.json and packages/app must match the tag: resolveDepVersionsPlugin reads
# packages/app/package.json (Vite root), so only bumping the repo root leaves __RESOLVED_PACKAGE_INFO__ at 0.0.0.
- name: Set package.json version from tag
run: |
VERSION=${GITHUB_REF_NAME}
VERSION=${VERSION#v}
npm version --no-commit-hooks --no-git-tag-version "$VERSION"
(cd packages/app && npm version --no-commit-hooks --no-git-tag-version "$VERSION")
- name: Build Docks app
run: npm run build:app
continue-on-error: false
- name: Verify build output
run: |
if [ ! -d "packages/app/dist" ]; then
echo "ERROR: packages/app/dist directory does not exist!"
exit 1
fi
if [ -z "$(ls -A packages/app/dist)" ]; then
echo "ERROR: packages/app/dist directory is empty!"
exit 1
fi
echo "Build output contents:"
ls -la packages/app/dist/
echo ""
echo "Files in packages/app/dist:"
find packages/app/dist -type f | head -20
- name: Add CNAME file
run: echo "docks.eclipse.dev" > packages/app/dist/CNAME
- name: Deploy to GitHub Pages branch
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: packages/app/dist
publish_branch: gh-pages
keep_files: false
- name: Deployment Summary
run: |
echo "## 🚀 Deployment Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Version: ${{ github.ref_name }}" >> $GITHUB_STEP_SUMMARY
echo "- ✅ Build successful" >> $GITHUB_STEP_SUMMARY
echo "- ✅ Deployed to GitHub Pages" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Access" >> $GITHUB_STEP_SUMMARY
echo "- **URL**: https://docks.eclipse.dev" >> $GITHUB_STEP_SUMMARY
echo "- **Commit**: ${{ github.sha }}" >> $GITHUB_STEP_SUMMARY
deploy-docs:
needs: deploy
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build docs
run: npm run docs:build
- name: Deploy docs to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/.vitepress/dist
destination_dir: docs
publish_branch: gh-pages
keep_files: true