Skip to content

Commit

Permalink
CI: Adds variable to build workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Mintoo200 committed Mar 19, 2024
1 parent 642e6c4 commit 9601e0f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ jobs:
build:
needs: [tests, type-check]
uses: ./.github/workflows/build.yml
with:
artifact-name: "lib-${{ github.head_ref }}"
build-storybook:
needs: [tests, type-check]
uses: ./.github/workflows/build-storybook.yml
Expand Down
19 changes: 17 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
name: 'Build'

on: [workflow_call, workflow_dispatch]
on:
workflow_call:
inputs:
artifact-name:
description: name of the artifact to be pushed
required: true
type: string
workflow_dispatch:
inputs:
artifact-name:
description: name of the artifact to be pushed
required: false
type: string

env:
ARTIFACT_NAME: ${{ inputs.artifact-name || format('lib-{0}', github.sha) }}

jobs:
build:
Expand All @@ -22,6 +37,6 @@ jobs:
uses: actions/upload-artifact@v4
with:
# TODO (GAFI 19-03-2024): Add variable for this to avoid using ref when not provided
name: lib-${{ github.head_ref }}
name: ${{ env.ARTIFACT_NAME }}
path: ./dist
if-no-files-found: error

0 comments on commit 9601e0f

Please sign in to comment.