refactor: remove LabelCustomColor (moving it to tackle2-ui) #316
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Preview | |
on: pull_request | |
jobs: | |
deploy-pr-preview: | |
name: Deploy Storybook | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up token | |
id: token | |
# This is a base64-encoded access token for the "migtools-preview-bot" GitHub account, which has no secure access and is only used to post comments. | |
run: echo "::set-output name=GH_TOKEN::`echo 'Z2hwX2ttclAzWUtjdUk4ZWJVRVVpZFJkdWlUOTJBS2pGODI2NUlyeQo=' | base64 -d`" | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: lts/* | |
- name: Install dependencies | |
run: yarn install | |
- name: Build Storybook | |
run: yarn storybook:export | |
- name: Generate Surge URL | |
uses: actions/github-script@v3 | |
id: surge-url | |
with: | |
github-token: ${{ steps.token.outputs.GH_TOKEN }} | |
script: | | |
const { issue: { number: issue_number } } = context; | |
return `migtools-lib-ui-pr-${issue_number}-preview.surge.sh`; | |
result-encoding: string | |
- name: Install Surge | |
run: npm install -g surge | |
- name: Deploy Storybook to Surge | |
run: surge ./storybook-static/ "${{steps.surge-url.outputs.result}}" --token 1d92e83069ba094ba43fbb71460a5f84 | |
- name: Post URL as PR comment | |
uses: mshick/add-pr-comment@v1 | |
with: | |
message: '🚀 Deployed Storybook Preview: http://${{steps.surge-url.outputs.result}} ✨' | |
repo-token: ${{ steps.token.outputs.GH_TOKEN }} |