-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (76 loc) · 2.8 KB
/
_cd-deploy.yml
File metadata and controls
87 lines (76 loc) · 2.8 KB
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
name: _CD Deploy (reusable)
on:
workflow_call:
inputs:
platform:
description: 'Platform to build (angular, react, wc, blazor, jquery)'
required: true
type: string
locale:
description: 'Locale to build (en or jp)'
required: true
type: string
target_ref:
description: 'Git ref to checkout'
required: true
type: string
secrets:
CLASSIC_PAT_GITHUB:
required: true
permissions:
contents: read
env:
BUILD_TYPE: ${{ contains(inputs.target_ref, 'master') && 'staging' || 'staging' }} # master targets production but for testing purposes we only deploy to staging
jobs:
build-and-deploy:
name: Build and Deploy
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ inputs.target_ref }}
clean: true
fetch-tags: true
fetch-depth: 0
- name: Setup Node.js 24.x
uses: actions/setup-node@v4
with:
node-version: '24.x'
- name: Install dependencies
run: npm ci
- name: Build Documentation for ${{ inputs.platform }} (${{ inputs.locale }})
run: npm run build:${{ env.BUILD_TYPE }}:${{ inputs.platform }}:${{ inputs.locale }}
- name: Package build
run: |
LOCALE="${{ inputs.locale }}"
DIST_DIR="dist/${{ inputs.platform }}$([[ "$LOCALE" == 'en' ]] && echo '' || echo "-$LOCALE")"
cd "$DIST_DIR"
zip -r ../../${{ env.BUILD_TYPE }}_${{ inputs.platform }}_${{ inputs.locale }}.zip .
cd ../..
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: igniteui-docs-${{ inputs.platform }}-${{ inputs.locale }}
path: ${{ env.BUILD_TYPE }}_${{ inputs.platform }}_${{ inputs.locale }}.zip
retention-days: 1
- name: Trigger Deploy Workflow in IgniteUI Actions
uses: actions/github-script@v8
with:
github-token: ${{ secrets.CLASSIC_PAT_GITHUB }}
script: |
await github.rest.repos.createDispatchEvent({
owner: 'IgniteUI',
repo: 'igniteui-actions',
event_type: 'igniteui-documentation-cd',
client_payload: {
calling_branch: "${{ inputs.target_ref }}",
environment: "${{ env.BUILD_TYPE }}",
artifact_name: "igniteui-docs-${{ inputs.platform }}-${{ inputs.locale }}",
base_href: "${{ inputs.platform == 'wc' && 'webcomponents' || inputs.platform }}site",
platform: "${{ inputs.platform }}",
repository: "${{ github.repository }}",
run_id: "${{ github.run_id }}",
locale: "${{ inputs.locale }}"
}
});