Skip to content

Commit

Permalink
chore: change storybook staging URL
Browse files Browse the repository at this point in the history
  • Loading branch information
DSil committed Jan 31, 2024
1 parent 436d54f commit f927627
Showing 1 changed file with 23 additions and 17 deletions.
40 changes: 23 additions & 17 deletions .github/workflows/storybook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,6 @@ jobs:
- name: Node
uses: ./.github/actions/node

- name: Compile design tokens
run: yarn tokens build

- name: Build tailwind
run: yarn tailwind-preset build

- name: Build Storybook
run: yarn components build:storybook

# TODO: find an alternative to using "if" statements for so many steps

- name: Get BRANCH_URL
# do not run on master branch
if: github.ref != 'refs/heads/master'
Expand All @@ -45,16 +34,33 @@ jobs:

- name: Get DOMAIN
if: github.ref != 'refs/heads/master'
run: echo "DOMAIN=https://orbit-mainframev-${BRANCH_URL}.surge.sh" >> $GITHUB_ENV
run: echo "DOMAIN=https://kiwicom-orbit-${BRANCH_URL}.surge.sh" >> $GITHUB_ENV

- name: Add comment to PR
if: github.ref != 'refs/heads/master' && github.run_number == 1
uses: actions/github-script@v6
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `Storybook staging is available at ${process.env.DOMAIN}`,
})
- name: Compile design tokens
run: yarn tokens build

- name: Build tailwind
run: yarn tailwind-preset build

- name: Build Storybook
run: yarn components build:storybook

- name: Deploy to staging
if: github.ref != 'refs/heads/master'
# we're adding to the domain name the username of the current owner of SURGE_TOKEN
run: |
yarn components deploy:surge ${DOMAIN} --token ${{ secrets.SURGE_TOKEN }}
yarn components deploy:updateURL --pr=${PR_NUMBER} --lastUrl=${DOMAIN} --token=${{ secrets.OCTO_TOKEN }} --urlName=Storybook
env:
PR_NUMBER: ${{ github.event.number }}
run: yarn components deploy:surge ${DOMAIN} --token ${{ secrets.SURGE_TOKEN }}

- name: Deploy to production
# run on master branch
Expand Down

0 comments on commit f927627

Please sign in to comment.