Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 52 additions & 1 deletion .github/workflows/node-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
required: false
type: string
default: 18.x
python-version:
required: false
type: string
working-directory:
required: false
type: string
Expand Down Expand Up @@ -44,6 +47,9 @@ on:
required: false
type: string
default: npm run build
post-build-script:
required: false
type: string
run-build:
required: false
type: boolean
Expand All @@ -59,6 +65,26 @@ on:
pre-run-script:
required: false
type: string
upload-artifact-name:
required: false
type: string
upload-artifact-path:
required: false
description: The full path to the artifact directory, this path does not take working-directory into account
type: string
default: .
download-artifact-name:
required: false
type: string
download-artifact-pattern:
required: false
type: string
download-artifact-path:
required: false
description: The full path to the artifact directory, this path does not take working-directory into account
type: string
default: .

secrets:
npm-auth-token:
description: NPM auth token (don't pass in on a PR build on a public repository)
Expand All @@ -81,14 +107,28 @@ jobs:

# setup node + private repo access
- name: Use Node.js ${{ inputs.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}
registry-url: 'https://npm.pkg.github.com'
scope: '@makerxstudio'
cache: 'npm'
cache-dependency-path: ${{ inputs.working-directory }}/package-lock.json

- name: Set up Python
if: ${{ inputs.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}

- name: Download artifacts
if: ${{ inputs.download-artifact-name || inputs.download-artifact-pattern }}
uses: actions/download-artifact@v4
with:
name: ${{ inputs.download-artifact-name }}
pattern: ${{ inputs.download-artifact-pattern }}
path: ${{ inputs.download-artifact-path }}

- name: Pre-run
if: ${{ inputs.pre-run-script }}
run: ${{ inputs.pre-run-script }}
Expand Down Expand Up @@ -139,3 +179,14 @@ jobs:
# CDK infrastructure build calls npm ci on /infrastructure/build, which may fail without NODE_AUTH_TOKEN
env:
NODE_AUTH_TOKEN: ${{ secrets.npm-auth-token || secrets.GITHUB_TOKEN }}

- name: Post build
if: ${{ inputs.post-build-script }}
run: ${{ inputs.post-build-script }}

- name: Publish artifact
if: ${{ inputs.upload-artifact-name }}
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.upload-artifact-name }}
path: ${{ inputs.upload-artifact-path }}