-
Notifications
You must be signed in to change notification settings - Fork 515
68 lines (64 loc) · 1.73 KB
/
push.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
name: Push
on:
push:
branches:
- main
jobs:
build:
uses: ./.github/workflows/test.yml
publish-npm:
name: Publish NPM packages
needs: build
runs-on: ubuntu-22.04
steps:
- uses: actions/setup-node@v4
with:
node-version: 18
registry-url: 'https://registry.npmjs.org'
- name: Update npm
run: |
npm update --global npm
npm --version
- uses: actions/checkout@v4
- run: npm install
- run: npm run compile
- name: Publish
run: ./scripts/ci_scripts/publishNpmPackages.sh
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
PROJECT_DIR: ${{ github.workspace }}
publish-docs:
name: Publish API documentation
needs: build
runs-on: ubuntu-22.04
steps:
- uses: actions/setup-node@v4
with:
node-version: 18
- name: Update npm
run: |
npm update --global npm
npm --version
- name: Checkout source
uses: actions/checkout@v4
with:
path: source
- name: Checkout publish
uses: actions/checkout@v4
with:
path: publish
ref: gh-pages
token: ${{ secrets.REPO_ACCESS_TOKEN }}
- run: npm install
working-directory: source
- run: npm run compile
working-directory: source
- name: Publish
run: ./scripts/ci_scripts/publishApiDocs.sh
working-directory: source
env:
GITHUB_USER: 'Hyperledger Bot'
GITHUB_EMAIL: '[email protected]'
PROJECT_DIR: ${{ github.workspace }}/source
PUBLISH_DIR: ${{ github.workspace }}/publish
SOURCE_BRANCH: ${{ github.ref_name }}