Skip to content

Commit 3c1ecf8

Browse files
author
Andrew Welch
committed
Add GitHub Action to build and deploy docs
1 parent 32cf387 commit 3c1ecf8

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Build and Deploy Docs
2+
env:
3+
DOCS_DEST_DIR: /transcoder/
4+
on:
5+
push:
6+
branches:
7+
- v1
8+
paths:
9+
- 'docs/**'
10+
pull_request:
11+
branches:
12+
- v1
13+
paths:
14+
- 'docs/**'
15+
workflow_dispatch:
16+
jobs:
17+
build:
18+
runs-on: ubuntu-latest
19+
defaults:
20+
run:
21+
working-directory: ./docs
22+
strategy:
23+
fail-fast: true
24+
matrix:
25+
node-version: [14.x]
26+
steps:
27+
- uses: actions/checkout@v2
28+
- name: Use Node.js ${{ matrix.node-version }}
29+
uses: actions/setup-node@v2
30+
with:
31+
node-version: ${{ matrix.node-version }}
32+
- run: npm ci
33+
- run: npm run docs:build
34+
- run: cp -vr docs/.vitepress/dist $GITHUB_WORKSPACE
35+
- name: rsync deployments
36+
uses: burnett01/rsync-deployments@4.1
37+
with:
38+
switches: -avzr --delete
39+
path: ./dist/
40+
remote_path: ${{ secrets.NYS_DOCS_ROOT }}${{ env.DOCS_DEST_DIR }}
41+
remote_host: ${{ secrets.NYS_DEPLOY_REMOTE_HOST }}
42+
remote_port: ${{ secrets.NYS_DEPLOY_REMOTE_PORT }}
43+
remote_user: ${{ secrets.NYS_DEPLOY_REMOTE_USER }}
44+
remote_key: ${{ secrets.NYS_DEPLOY_PRIVATE_KEY }}

0 commit comments

Comments
 (0)