-
-
Notifications
You must be signed in to change notification settings - Fork 38
52 lines (51 loc) · 1.32 KB
/
publish-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
52
name: Publish Documentation
on:
# Trigger the workflow on push,
# but only for the main branch
push:
branches:
- main
workflow_dispatch:
inputs:
prod_release:
description: 'Do you want to release to production?'
required: true
default: false
type: boolean
jobs:
Build-Deploy-Documentation:
runs-on: ubuntu-latest
steps:
- name: Check 🛎️
uses: actions/checkout@v2
- name: Install Node 16
uses: actions/setup-node@v2
with:
node-version: '16'
- name: Build & Test Documentation
run: |
cd docs
if [ -e package-lock.json ]; then
npm ci
else
npm i
fi
npm run build
# Adding publshing content
- name: Publish Content
if: ${{ inputs.prod_release }}
env:
GIT_USER: ${{ secrets.GIT_USER }}
GIT_PASS: ${{ secrets.GIT_USER_TOKEN }}
run: |
cd docs
git config --global user.name "${{ secrets.GIT_USER }}"
git config --global user.email "${{ secrets.GIT_USER_EMAIL }}"
if [ -e package-lock.json ]; then
npm ci
else
npm i
fi
echo 'docs.blazorbootstrap.com' > CNAME
cat CNAME
npm run deploy