2021-09-07 14:00:44 +02:00
|
|
|
name: 'Storybook Deployment'
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
- main
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
storybook-deployment:
|
|
|
|
runs-on: ubuntu-latest
|
2021-10-25 23:59:31 +02:00
|
|
|
if: github.repository == 'PostHog/posthog'
|
2021-09-07 14:00:44 +02:00
|
|
|
steps:
|
|
|
|
- name: Check out PostHog/posthog repo
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
path: posthog
|
|
|
|
fetch-depth: 0
|
2021-10-14 20:03:47 +02:00
|
|
|
|
2021-09-07 14:00:44 +02:00
|
|
|
- name: Install dependencies (yarn)
|
|
|
|
run: cd posthog && yarn
|
2021-10-14 20:03:47 +02:00
|
|
|
|
2021-09-07 14:00:44 +02:00
|
|
|
- name: Build storybook
|
|
|
|
run: cd posthog && yarn build-storybook
|
2021-10-14 20:03:47 +02:00
|
|
|
|
2021-09-07 14:00:44 +02:00
|
|
|
- name: Check out PostHog/storybook-build repo
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
path: storybook-build
|
|
|
|
repository: PostHog/storybook-build
|
|
|
|
token: ${{ secrets.POSTHOG_BOT_GITHUB_TOKEN }}
|
2021-10-14 20:03:47 +02:00
|
|
|
|
2021-09-07 14:00:44 +02:00
|
|
|
- name: Copy built changes to PostHog/storybook-build repo
|
|
|
|
run: |
|
|
|
|
# keep the CNAME file, but discard all the rest
|
|
|
|
cp storybook-build/docs/CNAME posthog/storybook-static/
|
|
|
|
rm -rf storybook-build/docs
|
|
|
|
cp -a posthog/storybook-static storybook-build/docs
|
2021-10-14 20:03:47 +02:00
|
|
|
|
2021-09-07 14:00:44 +02:00
|
|
|
- name: Commit update
|
|
|
|
uses: stefanzweifel/git-auto-commit-action@v4
|
|
|
|
with:
|
|
|
|
repository: storybook-build
|
|
|
|
commit_message: 'Storybook build'
|
|
|
|
commit_user_name: PostHog Bot
|
|
|
|
commit_user_email: hey@posthog.com
|
|
|
|
commit_author: PostHog Bot <hey@posthog.com>
|