fix button link #2643
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish preview Storybook to GitHub Pages | |
on: | |
push: | |
branches-ignore: | |
- main | |
permissions: | |
contents: read | |
env: | |
TARGET_PATH: "/storybook/${{ github.ref_name }}" | |
BASE_PATH: "/flow-previews/storybook/${{ github.ref_name }}" | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
environment: | |
name: github-pages-preview-storybook | |
url: https://mittwald.github.io${{ env.BASE_PATH }} | |
env: | |
PUBLISH_PAT: ${{ secrets.PUBLISH_PAT }} | |
GH_TOKEN: ${{ secrets.PUBLISH_PAT }} | |
steps: | |
- name: Checkout ⬇️ | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
version: 10 | |
- name: Setup Node 🎛️ | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
cache: "pnpm" | |
registry-url: "https://registry.npmjs.org" | |
- name: Git Identity 🪪 | |
run: | | |
git config user.name "${{ github.actor }}" | |
git config user.email "${{ github.actor }}@users.noreply.github.com" | |
- name: Install Dependencies 📦️ | |
run: pnpm install --frozen-lockfile | |
- name: Setup NX 1/2 🎛️ | |
uses: nrwl/nx-set-shas@v4 | |
- name: Setup NX 2/2 🎛 | |
if: github.ref != 'refs/heads/main' | |
run: git branch --track main origin/main | |
- name: Build 🔨 | |
run: pnpm build --exclude @mittwald/flow-documentation | |
- name: Build Storybook 🔨 | |
run: pnpm nx build:storybook components | |
- name: Upload files to GitHub Pages 🚀 | |
uses: maaaathis/github-action-push-to-another-repository@main | |
env: | |
API_TOKEN_GITHUB: ${{ secrets.PUBLISH_PAT }} | |
with: | |
source-directory: packages/components/storybook-static | |
destination-github-username: mittwald | |
destination-repository-name: flow-previews | |
target-branch: main | |
target-directory: "${{ env.TARGET_PATH }}" | |
clear-target-directory: true | |
- name: Output the URL | |
run: echo "${{ job.environment.url }}" |