Skip to content

Commit

Permalink
chore: add Playroom deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
sarkaaa committed Jan 16, 2025
1 parent 6eaa5c0 commit eb1a8cd
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 1 deletion.
52 changes: 52 additions & 0 deletions .github/workflows/playroom.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Playroom

on:
pull_request:
branches:
- "**"

jobs:
deploy:
runs-on: ubuntu-latest
permissions:
pull-requests: write # for dependabot
contents: write # for deploying to GitHub Pages on master
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Node
uses: ./.github/actions/node

- name: Compile design tokens
run: yarn tokens build

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

- name: Build Orbit components
run: yarn components build

- name: Build Playroom
run: yarn components build:playroom

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

# Get the number of the latest tag
- name: Version test
if: github.ref != 'refs/heads/master'
run: |
git fetch --tags --quiet
echo "VERSION_TAG=$(git tag --list '@kiwicom/orbit-components@*' --sort=creatordate | sed '$!d' | sed -n '$ s|.*@||; s/\./-/gp')" >> $GITHUB_ENV
# Create an URL for the Playroom
- name: Get DOMAIN
if: github.ref != 'refs/heads/master'
run: echo "DOMAIN=https://kiwicom-orbit-v${VERSION_TAG}.surge.sh" >> $GITHUB_ENV

- name: Deploy to staging
if: github.ref != 'refs/heads/master'
run: |
echo $DOMAIN
yarn components deploy:surge ${DOMAIN} --token ${{ secrets.SURGE_TOKEN }}
12 changes: 12 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ jobs:
yarn tokens build
yarn tailwind-preset build
yarn components build
yarn components build:playroom
yarn components build:storybook
- name: Dry run
if: ${{ github.event.inputs.dryrun == 'true' }}
Expand Down Expand Up @@ -72,3 +74,13 @@ jobs:
yarn docs changelog
git add docs/src/data/log.md && git commit -m "docs: update changelog" && git push
yarn zx scripts/post-changelog.mjs
- name: Get tag version
run: |
git fetch --tags --quiet
echo "VERSION_TAG=$(git tag --list '@kiwicom/orbit-components@*' --sort=creatordate | sed '$!d' | sed -n '$ s|.*@||; s/\./-/gp')" >> $GITHUB_ENV
- name: Get Storybook domain
run: |
echo "DOMAIN=https://kiwicom-orbit-v${VERSION_TAG}.surge.sh" >> $GITHUB_ENV
yarn components deploy:surge ${DOMAIN} --token ${{ secrets.SURGE_TOKEN }}
6 changes: 5 additions & 1 deletion .github/workflows/storybook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ jobs:
if: github.ref != 'refs/heads/master'
run: echo "DOMAIN=https://kiwicom-orbit-${BRANCH_URL}.surge.sh" >> $GITHUB_ENV

- name: Get Playroom DOMAIN
if: github.ref != 'refs/heads/master'
run: echo "DOMAIN_PLAYROOM=${DOMAIN}/playroom" >> $GITHUB_ENV

- name: Deploy to staging
if: github.ref != 'refs/heads/master'
run: yarn components deploy:surge ${DOMAIN} --token ${{ secrets.SURGE_TOKEN }}
Expand All @@ -61,7 +65,7 @@ jobs:
uses: actions/github-script@v6
with:
script: |
const commentBody = `Storybook staging is available at ${process.env.DOMAIN}`;
const commentBody = `Storybook staging is available at ${process.env.DOMAIN}\n Playroom staging is available at ${process.env.DOMAIN_PLAYROOM}`;
const commentsList = await github.rest.issues.listComments({
issue_number: context.issue.number,
Expand Down

0 comments on commit eb1a8cd

Please sign in to comment.