Skip to content

Updated CD with dist procedure #24

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

Merged
merged 24 commits into from
Dec 27, 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
7 changes: 5 additions & 2 deletions .github/workflows/cd-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ jobs:
run: npm ci

- name: Build Storybook
run: make storybook-build
run: make cd-build-storybook

- name: Setup Pages
uses: actions/configure-pages@v4

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: dist/storybook
path: .storybook/dist

- name: Deploy to GitHub Pages
id: deployment
Expand All @@ -68,6 +68,9 @@ jobs:
- name: Install dependencies
run: npm ci

- name: Build package
run: make cd-build-package

- name: Get version
id: package-version
run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/ci-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,8 @@ jobs:
- name: Tests
run: make ci-test

- name: Build
run: make ci-build
- name: Build Integrity Package
run: make cd-build-package

- name: Build Integrity Storybook
run: make cd-build-storybook
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/node_modules
/dist
/.storybook/dist
/coverage
6 changes: 1 addition & 5 deletions .storybook/caller.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,12 @@ npx_s=npx storybook

dev_port=39047
preview_port=8080
dist=dist/storybook
export dist=.storybook/dist

$(p)dev:
@$(call echo_yellow, "--> Running Storybook in development mode...")
$(run) $(npx_s) dev --no-open -p $(dev_port)

$(p)build:
@$(call echo_yellow, "--> Building Storybook...")
$(run) $(npx_s) build --docs -o $(dist)

$(p)preview-build-locally:
@$(call echo_yellow, "--> Starting server to preview storybook locally...")
npx http-server $(dist) -p $(preview_port)
7 changes: 7 additions & 0 deletions cd/caller.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
cd-build-package:
@$(call echo_yellow, "--> Building package...")
@npx vite build

cd-build-storybook:
@$(call echo_yellow, "--> Building Storybook...")
@$(run) $(npx_s) build --docs -o $(dist)
33 changes: 16 additions & 17 deletions ci/caller.mk
Original file line number Diff line number Diff line change
@@ -1,34 +1,33 @@
p=ci-

$(p)test:
ci-test:
@$(call echo_yellow, "--> Jest Testing...")
@npx jest

$(p)lint:
ci-lint:
@$(call echo_yellow, "--> Linting...")
@npx eslint src/

$(p)lint-fix:
ci-lint-fix:
@$(call echo_yellow, "--> Linting and fixing...")
@npx eslint src/ --fix

$(p)build:
@make storybook-build
@$(call echo_red, "--> removing dist folder...")
rm -rf dist

$(p)tsc:
ci-tsc:
@$(call echo_yellow, "--> Compiling...")
@npx tsc

$(p)local-all:
ci-local-all:
@$(call echo_blue, "--> Running all local CI tasks...")
@make -s $(p)lint
@make -s ci-lint
@$(call echo_green, "--> Linting done.")
@make -s $(p)tsc
@make -s ci-tsc
@$(call echo_green, "--> Compiling done.")
@make -s $(p)test
@make -s ci-test
@$(call echo_green, "--> Testing done.")
@make -s $(p)build
@$(call echo_green, "--> Building done.")

@$(call echo_purple, "--> Checking integrity of builds...")
@make -s cd-build-storybook
@$(call echo_green, "--> Storybook build successfull.")
@make -s cd-build-package
@$(call echo_green, "--> Package build successfull.")
@$(call echo_purple, "--> Build integrity checked.")

@$(call echo_blue, "--> All local CI tasks done.")
2 changes: 2 additions & 0 deletions makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
include ./.storybook/caller.mk
include ./ci/caller.mk
include ./cd/caller.mk


RED="\033[0;31m"
GREEN="\033[0;32m"
Expand Down
Loading
Loading