48 lines
1.1 KiB
YAML
48 lines
1.1 KiB
YAML
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) }}
|