-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (37 loc) · 1.15 KB
/
deploy.yml
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
name: Deploy to remote
on: [push, workflow_dispatch]
jobs:
build:
name: Build and Deploy
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true # Checkout private submodules(themes or something else).
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Build
run: |
bun install
bun run docs:build
- name: Build API docs
run: |
cd dev/api
bun install
bun run op:build
bun run docs:build
cp -r .vitepress/dist/ ../../.vitepress/dist/dev/api
cd ../../
- name: Setup SSH
uses: webfactory/ssh-agent@v0.7.0
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Add known host
run:
echo "${{ secrets.SSH_KNOWN_HOSTS }}" >> ~/.ssh/known_hosts
- name: Publish to remote
run: |
apt update && apt install rsync -y
rsync -av --delete -e "ssh -p ${{ secrets.SSH_PORT }}" .vitepress/dist/ ${{ secrets.SSH_USERNAME }}@${{ secrets.SSH_HOST }}:${{ secrets.WEB_ROOT }}