-
Notifications
You must be signed in to change notification settings - Fork 4
47 lines (40 loc) · 1.13 KB
/
publish.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
name: Publish
on:
release:
types:
- published
push:
branches:
- main
pull_request_target:
branches:
- main
jobs:
storybook:
name: Publish storybook
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Install NodeJS
uses: actions/setup-node@v4
with:
registry-url: https://npm.pkg.github.com
scope: "@eveshipfit"
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install dependencies
run: npm install
- name: Build storybook
run: npm run build-storybook
- name: Publish to Cloudflare Pages
uses: cloudflare/pages-action@v1
id: pages
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: ${{ vars.CLOUDFLARE_PROJECT_NAME }}
directory: storybook-static
branch: ${{ github.event_name == 'release' && 'main' || github.event_name == 'push' && 'latest' || format('pr/{0}', github.event.pull_request.number) }}