-
-
Notifications
You must be signed in to change notification settings - Fork 263
52 lines (50 loc) · 1.57 KB
/
build.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
52
name: Build
on:
# Run the build for pushes and pull requests targeting master
push:
branches:
- master
pull_request:
branches:
- master
# Used to trigger the build from external docs repos. Can by kicked off via:
# curl -X POST -H "Authorization: token $GH_PAT" -H "Accept: application/vnd.github.everest-preview+json" -H "Content-Type: application/json" https://api.github.com/repos/btcpayserver/btcpayserver-doc/dispatches --data '{"event_type": "build_docs"}'
repository_dispatch:
types:
- build_docs
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
# Checkout doc repo and its dependencies
- uses: actions/checkout@v3
# Setup Node
- uses: actions/setup-node@v3
with:
node-version: 16
cache: 'npm'
# Install, test and build
- name: Install
run: npm ci
# Link the dependencies
- name: Setup dependencies
run: ./setup-deps.sh
# Test and build
- name: Test
run: npm test
- name: Build
run: npm run build
# Deploy, limited to the master branch
- name: Redirects
if: success()
run: npm run redirects
- name: Deploy
if: success() && github.ref == 'refs/heads/master'
uses: peaceiris/actions-gh-pages@v3
with:
publish_dir: ./docs/.vuepress/dist
github_token: ${{ secrets.GITHUB_TOKEN }}
cname: docs.btcpayserver.org
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'