Skip to content

Commit

Permalink
Update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
majakomel committed Oct 13, 2023
1 parent 80ed7a0 commit 6732692
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions .github/workflows/storybook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ concurrency:
cancel-in-progress: true

jobs:
build-storybook:
build:
name: Build Storybook
runs-on: ubuntu-latest
timeout-minutes: 20
Expand All @@ -70,10 +70,10 @@ jobs:
name: storybook-static
path: storybook-static

deploy-storybook:
deploy:
name: Deploy Storybook
runs-on: ubuntu-latest
needs: build-storybook
needs: build
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -96,8 +96,8 @@ jobs:
- name: Deploy PR
if: github.event_name == 'pull_request'
run: |
git config --global user.name "majakomel"
git config --global user.email "majakomel@users.noreply.github.com"
git config --global user.name "${GITHUB_ACTOR}"
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
mkdir -p ${TARGET_DIR}
rm -rf ${TARGET_DIR}
mv storybook-static ${TARGET_DIR}
Expand All @@ -112,7 +112,7 @@ jobs:
# - name: Deploy master
# if: github.event_name == 'push'
# run: |
# find -mindepth 1 -delete
# find . -maxdepth 1 -type f -delete
# mv storybook-static .
# git add .
# git status
Expand All @@ -121,7 +121,18 @@ jobs:
# git commit -m "Deploy storybook for ${TARGET_DIR}."
# git push origin gh-pages

remove-storybook:
comment:
name: Comment with preview link
uses: peter-evans/create-or-update-comment@v3
needs: build
if: ( github.event_name == 'pull_request' && github.event.action == 'open' && contains( github.head_ref, 'dependabot/' ) == false ) && github.event.pull_request.head.repo.fork == false
with:
issue-number: ${{ github.event.pull_request.number }}
body: |
Preview:
https://ooni.github.io/design-system/pr/${{ github.event.number }}
remove:
name: Remove Storybook
runs-on: ubuntu-latest
timeout-minutes: 20
Expand Down

0 comments on commit 6732692

Please sign in to comment.