Skip to content

Commit 7fa23ce

Browse files
committed
ci: add workflow for deploying to server
1 parent 35f46fe commit 7fa23ce

1 file changed

Lines changed: 60 additions & 0 deletions

File tree

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Deploy VitePress site to LibreMesh server
2+
3+
on:
4+
# Runs on pushes targeting the `main` branch. Change this to `master` if you're
5+
# using the `master` branch as the default branch.
6+
push:
7+
branches: [main]
8+
9+
# Allows you to run this workflow manually from the Actions tab
10+
workflow_dispatch:
11+
12+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
13+
permissions:
14+
contents: read
15+
pages: write
16+
id-token: write
17+
18+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
19+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
20+
concurrency:
21+
group: pages
22+
cancel-in-progress: false
23+
24+
jobs:
25+
# Build job
26+
build_deploy:
27+
runs-on: ubuntu-latest
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@v5
31+
with:
32+
fetch-depth: 0 # Not needed if lastUpdated is not enabled
33+
submodules: 'recursive' # Fetch lime-packages and network-profiles
34+
- name: Install rsync
35+
run: |
36+
sudo apt-get update
37+
sudo apt-get install -y rsync
38+
- uses: pnpm/action-setup@v4 # Uncomment this block if you're using pnpm
39+
with:
40+
version: 9 # Not needed if you've set "packageManager" in package.json
41+
# - uses: oven-sh/setup-bun@v1 # Uncomment this if you're using Bun
42+
- name: Setup Node
43+
uses: actions/setup-node@v6
44+
with:
45+
node-version: 24
46+
cache: pnpm # or pnpm / yarn
47+
- name: Setup Pages
48+
uses: actions/configure-pages@v4
49+
- name: Install dependencies
50+
run: pnpm install # or pnpm install / yarn install / bun install
51+
- name: Prebuild with VitePress
52+
run: pnpm run prebuild # or pnpm docs:build / yarn docs:build / bun run docs:build
53+
- name: Build with VitePress
54+
run: pnpm run build # or pnpm docs:build / yarn docs:build / bun run docs:build
55+
56+
- name: Upload using rsync
57+
run: |
58+
mkdir .ssh/; echo ${{ secrets.RSYNC_PASSWORD }} > .ssh/id_ed25519
59+
ssh-keyscan -H ${{ secrets.RSYNC_HOST }} >> .ssh/known_hosts
60+
rsync -va --rsh="ssh -i .ssh/id_ed25519" docs/.vitepress/dist ${{ secrets.RSYNC_USER }}@${{ secrets.RSYNC_HOST }}:/home/${{ secrets.RSYNC_USER }}/site

0 commit comments

Comments
 (0)