Skip to content

Commit 9eeff55

Browse files
authored
Update build-node w/ same inputs as build-node-python
1 parent 0b49a22 commit 9eeff55

File tree

1 file changed

+30
-7
lines changed

1 file changed

+30
-7
lines changed

.github/workflows/build-node.yml

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,20 @@ on:
77
type: string
88
required: false
99
default: ${{ github.ref || github.head_ref }}
10+
chromatic_enable:
11+
description: 'Enable Chromatic Tests'
12+
required: false
13+
type: boolean
14+
default: false
15+
node_run_webpack:
16+
description: "Flag to always run the webpack production build."
17+
type: boolean
18+
required: false
19+
default: false
20+
runs_on:
21+
type: string
22+
required: false
23+
default: "ubuntu-22.04"
1024
secrets:
1125
DATAVISYN_BOT_REPO_TOKEN:
1226
required: false
@@ -36,19 +50,28 @@ jobs:
3650
contents: write
3751
runs-on: ubuntu-22.04
3852
steps:
39-
# checkout specific source repository
40-
- uses: actions/checkout@v3
53+
- name: Checkout source repository
54+
uses: actions/checkout@v4
4155
with:
4256
ref: ${{ inputs.branch }}
43-
token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }} # has to set because otherwise it will not work
44-
# checkout this workflow repository to get actions
45-
- uses: actions/checkout@v3
57+
token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
58+
fetch-depth: ${{ inputs.chromatic_enable && '0' || '1' }}
59+
- name: Checkout github-workflows
60+
uses: actions/checkout@v4
4661
with:
4762
repository: datavisyn/github-workflows
4863
ref: ${{ env.WORKFLOW_BRANCH }}
4964
path: ./tmp/github-workflows
50-
- uses: ./tmp/github-workflows/.github/actions/build-node
65+
- name: Build node
66+
uses: ./tmp/github-workflows/.github/actions/build-node
5167
with:
5268
node_version: ${{ secrets.NODE_VERSION || env.NODE_VERSION }}
5369
npm_registry: ${{ env.NPM_REGISTRY }}
54-
github_ro_token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
70+
github_ro_token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
71+
run_webpack: ${{ inputs.node_run_webpack }}
72+
enable_cache: ${{ inputs.runs_on != 'self-hosted' }}
73+
- name: Run Chromatic
74+
if: ${{ inputs.chromatic_enable }}
75+
uses: chromaui/[email protected]
76+
with:
77+
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}

0 commit comments

Comments
 (0)