-
Notifications
You must be signed in to change notification settings - Fork 13
77 lines (74 loc) · 2.04 KB
/
publish.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: Publish package
on:
workflow_dispatch:
inputs:
version:
description: 'The version to bump'
required: true
default: 'patch'
type: choice
options:
- patch
- minor
- major
jobs:
publishPackage:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install dependencies
run: yarn
- name: Build
run: yarn build
- name: Bump version
run: |
git config --global user.name 'Neogma publisher'
git config --global user.email 'themetalfleece@users.noreply.github.com'
npm version ${{ inputs.version }}
- name: Push
run: git push
- name: Push tags
run: git push --tags
- name: Publish to npm
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
publishDocs:
needs: publishPackage
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install codedoc
run: |
npm i -g @codedoc/cli
- name: Install dependencies
run: |
cd documentation/.codedoc
npm ci
- name: Build docs
run: |
cd documentation
codedoc build
- name: Move related files to tmp
run: |
mkdir /tmp/neogma
cp -r ./documentation/docs /tmp/neogma/docs
cp documentation/index.html /tmp/neogma/index.html
cp documentation/favicon.ico /tmp/neogma/favicon.ico
- name: Checkout docs
uses: actions/checkout@v3
with:
ref: docs
- name: Push built files
run: |
rm -rf docs
rm -f index.html
rm -f favicon.ico
cp -r /tmp/neogma/* .
git config --global user.name 'Docs builder'
git config --global user.email 'themetalfleece@users.noreply.github.com'
git add .
git commit -m "Build docs"
git push --force origin docs