Skip to content

Commit ccc9ad0

Browse files
feat: deploy website to GitHub Pages on release (#68)
* feat: deploy website to GitHub Pages on release Add gh-pages target to craft configuration so the website dashboard is automatically deployed to GitHub Pages when a release is published. Changes: - Add build_website job to CI workflow that builds the Vite app and uploads a gh-pages.zip artifact - Register the gh-pages artifact and target in .craft.yml - Set Vite base path to /codecov-action/ for correct asset URLs - Add basename to BrowserRouter for subpath routing - Fix broken Github icon import (removed in lucide-react 1.x) * Update index.js * fix: add permissions block to build_website job Restrict GITHUB_TOKEN to contents:read only, as flagged by github-advanced-security.
1 parent ac794ed commit ccc9ad0

6 files changed

Lines changed: 1181 additions & 160 deletions

File tree

.craft.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,7 @@ artifactProvider:
77
artifacts:
88
Build & Test:
99
- action-package
10+
- gh-pages
1011
targets:
1112
- name: github
13+
- name: gh-pages

.github/workflows/build.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,36 @@ jobs:
5050
with:
5151
name: action-package
5252
path: "*.tgz"
53+
54+
build_website:
55+
runs-on: ubuntu-latest
56+
permissions:
57+
contents: read
58+
59+
steps:
60+
- name: Checkout
61+
uses: actions/checkout@v6
62+
63+
- name: Set up Node.js
64+
uses: actions/setup-node@v6
65+
with:
66+
node-version: 24
67+
68+
- name: Install pnpm
69+
run: npm install -g pnpm
70+
71+
- name: Install dependencies
72+
run: pnpm install
73+
74+
- name: Build website
75+
working-directory: website
76+
run: pnpm run build
77+
78+
- name: Package for gh-pages
79+
run: cd website/dist && zip -r ../../gh-pages.zip .
80+
81+
- name: Upload gh-pages artifact
82+
uses: actions/upload-artifact@v7
83+
with:
84+
name: gh-pages
85+
path: gh-pages.zip

0 commit comments

Comments
 (0)