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 68f5433
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 2 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/playroom.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Playroom

on:
push:
# Pattern matched against refs/tags
tags:
- "*"

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

# Get the number of the latest tag
- name: Version test
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
run: echo "DOMAIN=https://kiwicom-orbit-v${VERSION_TAG}.surge.sh" >> $GITHUB_ENV

- name: Deploy to staging
run: echo $DOMAIN
# run: yarn components deploy:surge ${DOMAIN} --token ${{ secrets.SURGE_TOKEN }}
10 changes: 10 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,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 }}
11 changes: 9 additions & 2 deletions .github/workflows/storybook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,14 @@ jobs:

- name: Get DOMAIN
if: github.ref != 'refs/heads/master'
run: echo "DOMAIN=https://kiwicom-orbit-${BRANCH_URL}.surge.sh" >> $GITHUB_ENV
run: |
echo "DOMAIN=https://kiwicom-orbit-${BRANCH_URL}.surge.sh" >> $GITHUB_ENV
echo "DOMAIN_PLAYROOM=${env.DOMAIN}/playroom" >> $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'
Expand All @@ -61,7 +68,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 68f5433

Please sign in to comment.