Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Add variables to artifact names #6

Merged
merged 4 commits into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
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
6 changes: 5 additions & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: "CI"

on: [push]
on: [pull_request]

jobs:
tests:
Expand All @@ -10,6 +10,10 @@ 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
with:
artifact-name: "storybook-${{ github.head_ref }}"
20 changes: 18 additions & 2 deletions .github/workflows/build-storybook.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
name: 'Build Storybook'

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('storybook-{0}', github.sha) }}

jobs:
build:
Expand All @@ -21,6 +36,7 @@ jobs:
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: storybook-${{ github.sha }}
# TODO (GAFI 19-03-2024): Add variable for this to avoid using ref when not provided
name: ${{ env.ARTIFACT_NAME }}
path: ./storybook-static
if-no-files-found: error
20 changes: 18 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 @@ -21,6 +36,7 @@ jobs:
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: lib-${{ github.sha }}
# TODO (GAFI 19-03-2024): Add variable for this to avoid using ref when not provided
name: ${{ env.ARTIFACT_NAME }}
path: ./dist
if-no-files-found: error