forked from PostHog/posthog
-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (53 loc) · 2.12 KB
/
storybook-deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
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@v4
with:
package_json_file: posthog/package.json
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 18.12.1
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: Set commit message
id: commit-message
run: echo "msg=Storybook build for ${{ github.sha }}" >> $GITHUB_OUTPUT
- name: Commit update
uses: stefanzweifel/git-auto-commit-action@v5
with:
repository: storybook-build
commit_message: ${{ steps.commit-message.outputs.msg }}
commit_user_name: PostHog Bot
commit_user_email: [email protected]
commit_author: PostHog Bot <[email protected]>