Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

Commit

Permalink
ci: publish-storybooks improvements (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeyRoyt authored Jan 3, 2024
2 parents d5a4f56 + e2d4db5 commit 29bfa61
Showing 1 changed file with 28 additions and 20 deletions.
48 changes: 28 additions & 20 deletions .github/workflows/publish-storybooks.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
# Publish Storybooks to GitHub Pages - on push to master or workflow_dispatch with package selection - builds and pushes storybook-static folders to gh-pages branches
name: Publish Storybooks

on:
# workflow_run:
# workflows: ["Release new version"]
# types:
# - completed
push:
branches:
- master # maybe should also avoid release commits - from "ci" user
workflow_dispatch:
inputs:
monday-ui-react-core:
required: false
type: boolean
description: "Deploy monday-ui-react-core Storybook"
description: "monday-ui-react-core"
monday-ui-style:
required: false
type: boolean
description: "Deploy monday-ui-style Storybook"
description: "monday-ui-style"
vibe-storybook-components:
required: false
type: boolean
description: "Deploy vibe-storybook-components Storybook"
description: "vibe-storybook-components"

permissions:
contents: write

jobs:
build-and-deploy:
Expand All @@ -34,12 +37,14 @@ jobs:
yarn install --frozen-lockfile
yarn build
yarn build-storybook
echo ::set-output name=success::$(echo "true")
# echo "style.monday.com" > ./CNAME
env:
NODE_AUTH_TOKEN: ${{ secrets.npm_token }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Set up git credentials
run: |
git config --global user.name 'ci'
git config --global user.email 'deploy@monday.com'
- name: "Build failed - exit"
if: ${{ steps.build_step.outputs.success != 'true' }}
if: success() != true
run: |
echo "::error::build_step failed - publish-storybooks cancelled"
exit 1
Expand All @@ -52,25 +57,28 @@ jobs:
echo "USER_INPUT: ${{ env.USER_INPUT }}"
- name: Push monday-ui-react-core Storybook to Github Pages
if: ${{ env.USER_INPUT == 'false' }} || ${{ github.event.inputs.monday-ui-react-core == 'true' }}
uses: crazy-max/ghaction-github-pages@v2
uses: JamesIves/github-pages-deploy-action@v4.5.0
with:
target_branch: "gh-pages-monday-ui-react-core"
build_dir: "packages/monday-ui-react-core/storybook-static"
folder: "packages/monday-ui-react-core/storybook-static"
branch: "gh-pages"
target-folder: "monday-ui-react-core"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Push monday-ui-style Storybook to Github Pages
if: ${{ env.USER_INPUT == 'false' }} || ${{ github.event.inputs.monday-ui-style == 'true' }}
uses: crazy-max/ghaction-github-pages@v2
uses: JamesIves/github-pages-deploy-action@v4.5.0
with:
target_branch: "gh-pages-monday-ui-style"
build_dir: "packages/monday-ui-style/storybook-static"
folder: "packages/monday-ui-style/storybook-static"
branch: "gh-pages"
target-folder: "monday-ui-style"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Push vibe-storybook-components Storybook to Github Pages
if: ${{ env.USER_INPUT == 'false' }} || ${{ github.event.inputs.vibe-storybook-components == 'true' }}
uses: crazy-max/ghaction-github-pages@v2
uses: JamesIves/github-pages-deploy-action@v4.5.0
with:
target_branch: "gh-pages-vibe-storybook-components"
build_dir: "packages/vibe-storybook-components/storybook-static"
folder: "packages/vibe-storybook-components/storybook-static"
branch: "gh-pages"
target-folder: "vibe-storybook-components"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 29bfa61

Please sign in to comment.