-
-
Notifications
You must be signed in to change notification settings - Fork 57
53 lines (43 loc) · 1.22 KB
/
update-docs.yaml
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
name: Update Docs
on:
push:
branches:
- master
jobs:
update-docs:
runs-on: ubuntu-latest
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Configure Git
run: |
# Configure Git
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '16' # Update based on your project's requirements
- name: Build
run: |
cd docs;
npm install
cd ..
ls -la
node docs/build.js
- name: Checkout docs repository
uses: actions/checkout@v3
with:
path: distr
ref: docs
- name: Deploy docs
run: |
rsync -av --exclude='.git/' --del build/ distr/
cd distr
git add .
git commit -m "Update docs on $(date)"
git push --force origin docs