-
Notifications
You must be signed in to change notification settings - Fork 24
60 lines (54 loc) · 2.01 KB
/
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
53
54
55
56
57
58
59
60
name: Gitbook Sync
on:
release:
types: [released, prereleased]
# Todo - come up with a reasonable strategy for previewing docs changes
push:
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
- name: Checkout
uses: actions/checkout@v4
with:
repository: "Mintbase/gitbook-docs"
ref: "main"
path: "docs/gitbook-docs"
token: ${{ secrets.GITHUB_TOKEN }}
ssh-key: ${{ secrets.TEAM_ACCOUNT_KEY }}
persist-credentials: true
- name: Copy and Publish Docs (Release or beta Merge)
# for now - roll out docs on merge to beta
if: ${{ github.event.release.tag_name || github.ref_name == 'beta' }}
working-directory: "docs/gitbook-docs"
env:
github-token: ${{ secrets.GITHUB_TOKEN }}
run: |
rm -rf mintbase-sdk-ref/
node ../migrate.js
git config --global user.name "mintbaseteam"
git config --global user.email "eng@mintbase.io"
git add --all
git commit -m "📒 🤖 [mintbase-js] ${{ github.event.release.tag_name }}" || true
git push origin HEAD
# This is causing too much branch pollution, not really necessary for now
# - name: Copy and Publish Docs (Preview)
# if: ${{ github.event.head_commit.message || }}
# working-directory: "docs/gitbook-docs"
# env:
# github-token: ${{ secrets.GITHUB_TOKEN }}
# run: |
# rm -rf mintbase-sdk-ref/
# node ../migrate.js
# git config --global user.name "mintbaseteam"
# git config --global user.email "eng@mintbase.io"
# git checkout -b ${{ github.ref_name }}
# git add --all
# git commit -m "📒 🤖 [mintbase-js] ${{ github.event.head_commit.message }}" || true
# git push origin HEAD --force