-
Notifications
You must be signed in to change notification settings - Fork 128
119 lines (101 loc) · 3.55 KB
/
workflow-deployments.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
name: Documentation and NPM package
on:
workflow_call:
inputs:
node_lts_maintenance_version:
description: "Maintenance Node LTS Version"
required: true
default: "18"
type: string
node_lts_active_version:
description: "Active Node LTS Version"
required: true
default: "20"
type: string
node_lts_current_version:
description: "Current Node LTS Version"
required: true
default: "22"
type: string
workflow_dispatch:
inputs:
doc_deploy:
description: "Deploy Documentation"
required: true
default: true
type: boolean
npm_deploy:
description: "Deploy to NPM"
required: true
default: true
type: boolean
node_lts_maintenance_version:
description: "Maintenance Node LTS Version"
required: true
default: "18"
type: string
node_lts_active_version:
description: "Active Node LTS Version"
required: true
default: "20"
type: string
node_lts_current_version:
description: "Current Node LTS Version"
required: true
default: "22"
type: string
jobs:
doc-deploy:
name: Documentation - Deploy
if: ${{ (github.event_name != 'workflow_dispatch' || inputs.doc_deploy) && (github.ref_name == 'master' || github.ref_name == 'beta') }}
runs-on: ubuntu-24.04
steps:
- name: Checkout project
uses: actions/checkout@v4
- name: Install additional libraries
uses: ./.github/actions/install-packages
- name: Extract references from context
shell: bash
id: extract-refs
run: |
echo "major-version=$(jq -r .version package.json | cut -d. -f 1)" >> $GITHUB_OUTPUT
echo "repo=$(echo $GITHUB_REPOSITORY | cut -d/ -f 2)" >> $GITHUB_OUTPUT
- name: Trigger documentation workflow
uses: convictional/[email protected]
with:
owner: kuzzleio
repo: documentation
github_token: ${{ secrets.ACCESS_TOKEN_CI }}
workflow_file_name: child_repo.workflow.yml
ref: ${{ github.ref_name == 'master' && 'master' || 'develop' }}
client_payload: '{"repo_name":"${{ steps.extract-refs.outputs.repo }}","branch":"${{ github.head_ref }}","version":"${{ steps.extract-refs.outputs.major-version }}"}'
npm-deploy:
name: Build and deploy release on NPM.js
if: ${{ (github.event_name != 'workflow_dispatch' || inputs.npm_deploy) && (github.ref_name == 'master' || github.ref_name == 'beta') }}
runs-on: ubuntu-24.04
permissions:
contents: write
issues: write
pull-requests: write
steps:
- name: Checkout project
uses: actions/checkout@v4
- name: Install additional libraries
uses: ./.github/actions/install-packages
- name: Node version ${{ inputs.node_lts_current_version }}
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node_lts_current_version }}
registry-url: "https://registry.npmjs.org"
scope: "@kuzzleio"
- name: Install depedencies
run: npm ci
- name: Build depedencies
run: npm run build
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_GHP }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
SEMANTIC_RELEASE_NPM_PUBLISH: "true"
SEMANTIC_RELEASE_SLACK_WEBHOOK: ${{ secrets.SEMANTIC_RELEASE_SLACK_WEBHOOK }}
run: npx semantic-release