-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (40 loc) · 1.34 KB
/
deploy-docs.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: Deploy Docs
on:
workflow_dispatch:
push:
branches: [main]
paths: ['docs/**']
permissions:
contents: read
env:
NPM_VERSION: 21.7.2
jobs:
deploy:
name: Deploy Docs
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup PNPM
uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0
# Install version depends on package.json `packageManager` field
- name: Setup Node.js
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: ${{ env.NPM_VERSION }}
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile --prefer-offline
- name: Run build
run: pnpm run build:docs
- name: Deploy to Server
uses: burnett01/rsync-deployments@796cf0d5e4b535745ce49d7429f77cf39e25ef39 # 7.0.1
with:
switches: -avzr --delete
path: "./docs/dist/*"
remote_path: ${{ secrets.REMOTE_PATH }}
remote_host: ${{ secrets.FTP_SERVER }}
remote_user: ${{ secrets.FTP_USERNAME }}
remote_key: ${{ secrets.SSH_PRIVATE_KEY }}