-
Notifications
You must be signed in to change notification settings - Fork 1
79 lines (68 loc) · 2.28 KB
/
hajar-beta.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
78
79
name: Hajar CI - @beta
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
NPM_PUBLISH_TAG: beta # Specify the tag for publishing
on:
push:
branches: [main]
jobs:
publish-package:
if: ${{!contains(github.event.head_commit.message, 'skip_publish')}}
runs-on: [self-hosted, linux, x64, A01]
strategy:
matrix:
node-version: [21.x]
steps:
- uses: actions/checkout@v4
with:
clean: false
- name: Append -beta to package.json version
run: |
node -e "const fs = require('fs'); const packageJson = require('./package.json'); packageJson.version += '-beta'; fs.writeFileSync('./package.json', JSON.stringify(packageJson, null, 2));"
- uses: actions/setup-node@v2
with:
node-version: 21
registry-url: https://registry.npmjs.org/
always-auth: true
- name: Install dependencies
run: |
if [ -e 'package-lock.json' ]; then
npm ci
else
npm install
fi
- name: Build Library
run: npm run build --if-present
- name: Test & Lint
run: |
npm run test:coverage --if-present
npm run lint --if-present
- name: Publish to NPM @beta tag
run: npm publish --tag $NPM_PUBLISH_TAG
deploy-docs:
if: ${{ contains(github.event.head_commit.message, 'deploy_docs') }}
runs-on: [self-hosted, linux, x64, A01]
strategy:
matrix:
node-version: [21.x]
steps:
- uses: actions/checkout@v2
with:
clean: false
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Install Hajar Docs
run: |
rm -fr /home/sikka-hajar/htdocs/hajar.sikka.io || true
cd /var/www/html/sikka-software/_work/Hajar/Hajar/docs
rm -fr package-lock.json || true
rm -fr node_modules || true
npm install
npm run build --if-present
ln -s /var/www/html/sikka-software/_work/Hajar/Hajar/docs /home/sikka-hajar/htdocs/hajar.sikka.io
pm2 stop hajar-docs || true
pm2 delete hajar-docs || true
pm2 start npm --name "hajar-docs" -- start || true
pm2 save || true