0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-28 18:26:15 +01:00
posthog/.github/workflows/storybook-deploy.yml
2022-12-12 15:02:33 +01:00

60 lines
1.9 KiB
YAML

name: 'Storybook Deployment'
on:
push:
branches:
- master
- main
jobs:
storybook-deployment:
runs-on: ubuntu-latest
if: github.repository == 'PostHog/posthog'
steps:
- name: Check out PostHog/posthog repo
uses: actions/checkout@v3
with:
path: posthog
fetch-depth: 0
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 7.x.x
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 18
cache: pnpm
cache-dependency-path: posthog/pnpm-lock.yaml
- name: Install dependencies (pnpm)
run: cd posthog && pnpm i
- name: Build storybook
run: cd posthog && pnpm build-storybook
- name: Check out PostHog/storybook-build repo
uses: actions/checkout@v3
with:
path: storybook-build
repository: PostHog/storybook-build
token: ${{ secrets.POSTHOG_BOT_GITHUB_TOKEN }}
- 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
- 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>