Skip to content

Commit 2a83bdf

Browse files
Merge pull request #1 from silverorange/build-to-gh-pages
Build to GH pages
2 parents 729dbc8 + b689b10 commit 2a83bdf

6 files changed

Lines changed: 76 additions & 5 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Sample workflow for building and deploying a VitePress site to GitHub Pages
2+
# https://vitepress.dev/guide/deploy#github-pages
3+
#
4+
name: Deploy VitePress site to Pages
5+
6+
on:
7+
# Runs on pushes targeting the `main` branch. Change this to `master` if you're
8+
# using the `master` branch as the default branch.
9+
push:
10+
branches: [main]
11+
12+
# Allows you to run this workflow manually from the Actions tab
13+
workflow_dispatch:
14+
15+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
16+
permissions:
17+
contents: read
18+
pages: write
19+
id-token: write
20+
21+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
22+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
23+
concurrency:
24+
group: pages
25+
cancel-in-progress: false
26+
27+
jobs:
28+
# Build job
29+
build:
30+
runs-on: ubuntu-latest
31+
steps:
32+
- name: Checkout
33+
uses: actions/checkout@v4
34+
with:
35+
fetch-depth: 0 # Not needed if lastUpdated is not enabled
36+
# - uses: pnpm/action-setup@v3 # Uncomment this block if you're using pnpm
37+
# with:
38+
# version: 9 # Not needed if you've set "packageManager" in package.json
39+
# - uses: oven-sh/setup-bun@v1 # Uncomment this if you're using Bun
40+
- name: Setup Node
41+
uses: actions/setup-node@v4
42+
with:
43+
node-version: 22
44+
cache: npm # or pnpm / yarn
45+
- name: Setup Pages
46+
uses: actions/configure-pages@v4
47+
- name: Install dependencies
48+
run: npm ci # or pnpm install / yarn install / bun install
49+
- name: Build with VitePress
50+
run: npm run docs:build # or pnpm docs:build / yarn docs:build / bun run docs:build
51+
- name: Upload artifact
52+
uses: actions/upload-pages-artifact@v3
53+
with:
54+
path: docs/.vitepress/dist
55+
56+
# Deployment job
57+
deploy:
58+
environment:
59+
name: github-pages
60+
url: ${{ steps.deployment.outputs.page_url }}
61+
needs: build
62+
runs-on: ubuntu-latest
63+
name: Deploy
64+
steps:
65+
- name: Deploy to GitHub Pages
66+
id: deployment
67+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
/node_modules
33

44
# vitepress related files
5-
.vitepress/cache
6-
.vitepress/build
5+
/docs/.vitepress/cache
6+
/docs/.vitepress/dist
7+
8+
# IDE related files
9+
/.idea
710

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export default withMermaid({
55
// your existing vitepress config...
66
title: 'silverorange Project Principles',
77
description: 'Principles to follow for joyful software development!',
8+
base: '/project-principles/',
89
themeConfig: {
910
// https://vitepress.dev/reference/default-theme-config
1011
nav: [{ text: 'Home', link: '/' }],
File renamed without changes.
File renamed without changes.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
},
77
"packageManager": "pnpm@8.15.4+sha256.cea6d0bdf2de3a0549582da3983c70c92ffc577ff4410cbf190817ddc35137c2",
88
"scripts": {
9-
"docs:dev": "vitepress dev",
10-
"docs:build": "vitepress build",
11-
"docs:preview": "vitepress preview"
9+
"docs:dev": "vitepress dev docs",
10+
"docs:build": "vitepress build docs",
11+
"docs:preview": "vitepress preview docs"
1212
}
1313
}

0 commit comments

Comments
 (0)