-
Notifications
You must be signed in to change notification settings - Fork 23
64 lines (54 loc) · 1.8 KB
/
Copy pathdocs-deploy.yml
File metadata and controls
64 lines (54 loc) · 1.8 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
# actionlint: allow-secrets DOCS_HOST,DOCS_USER,DOCS_SSH_KEY,DOCS_PORT,DOCS_PATH
name: Deploy Documentation
on:
push:
branches:
- master
- 2.0.0-beta1
paths:
- 'docs/**'
- 'package.json'
- 'package-lock.json'
- '.github/workflows/docs-deploy.yml'
workflow_dispatch:
concurrency:
group: docs-deploy-${{ github.ref }}
cancel-in-progress: true
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build VitePress site
run: npm run docs:build
env:
DOCS_BASE: /
- name: Check deployment prerequisites
id: check
uses: ./.github/actions/check-docs-deploy
with:
host: ${{ secrets.DOCS_HOST }} # actionlint: allow
user: ${{ secrets.DOCS_USER }} # actionlint: allow
ssh_key: ${{ secrets.DOCS_SSH_KEY }} # actionlint: allow
port: ${{ secrets.DOCS_PORT }} # actionlint: allow
path: ${{ secrets.DOCS_PATH }} # actionlint: allow
- name: Deploy documentation bundle
if: steps.check.outputs.ready == 'true'
uses: ./.github/actions/deploy-docs
with:
host: ${{ steps.check.outputs.host }}
user: ${{ steps.check.outputs.user }}
port: ${{ steps.check.outputs.port }}
path: ${{ steps.check.outputs.path }}
ssh_key: ${{ secrets.DOCS_SSH_KEY }} # actionlint: allow
- name: Deployment skipped
if: steps.check.outputs.ready != 'true'
run: echo "Documentation build complete, but deploy secrets are missing so upload was skipped."