fix: storybook components and create preview site #165
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: Release | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| concurrency: ${{ github.workflow }}-${{ github.ref }} | |
| jobs: | |
| changesets: | |
| name: Changesets | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pull-requests: write | |
| contents: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v7 | |
| - name: Node Modules Cache | |
| uses: actions/cache@v5 | |
| with: | |
| path: node_modules | |
| key: ${{ runner.os }}-${{ hashFiles('bun.lock') }} | |
| - name: Checkout nodejs | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: '24.15.0' | |
| registry-url: 'https://registry.npmjs.org' | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: '1.3.13' | |
| - name: Install Deps | |
| run: bun ci | |
| - name: Install tools | |
| run: | | |
| curl -sSfL https://raw.githubusercontent.com/trufflesecurity/trufflehog/main/scripts/install.sh | sh -s -- -b /usr/local/bin | |
| git clone https://github.com/gitleaks/gitleaks.git "$RUNNER_TEMP/gitleaks" | |
| cd "$RUNNER_TEMP/gitleaks" && make build | |
| sudo mv gitleaks /usr/local/bin | |
| sudo curl -o /usr/local/bin/jq -L https://github.com/stedolan/jq/releases/download/jq-1.8.1/jq-linux64 && sudo chmod +x /usr/local/bin/jq | |
| - name: Check tools | |
| run: | | |
| which trufflehog | |
| which gitleaks | |
| which jq | |
| - name: Version script | |
| if: github.event_name == 'pull_request' | |
| run: npm run version | |
| - name: Create Tag | |
| if: github.event_name == 'push' | |
| run: | | |
| npx changeset tag | |
| git push --follow-tags | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Create Release Pull Request | |
| if: github.event_name == 'push' | |
| uses: changesets/action@v1 | |
| with: | |
| version: npm run version | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| npm: | |
| name: npmjs.com | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v7 | |
| - name: Node Modules Cache | |
| uses: actions/cache@v5 | |
| with: | |
| path: node_modules | |
| key: ${{ runner.os }}-${{ hashFiles('bun.lock') }} | |
| - name: Checkout nodejs | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: '24.15.0' | |
| registry-url: 'https://registry.npmjs.org' | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: '1.3.13' | |
| - name: Update NPM | |
| run: npm i -g npm@11.16.0 | |
| - name: Install Deps | |
| run: bun ci | |
| - name: Build | |
| working-directory: ./lib/distopia | |
| run: bun run build | |
| - name: Publish | |
| continue-on-error: true | |
| id: publish | |
| run: scripts/npm-publish.sh ${{ github.event_name == 'pull_request' && '--dry-run' || '' }} | |
| env: | |
| NPM_TOKEN: '' | |
| - name: Dump npm debug log | |
| if: steps.publish.outcome == 'failure' | |
| run: | | |
| cat /home/runner/.npm/_logs/*-debug-0.log || true | |
| exit 1 | |
| jsr: | |
| name: jsr.io | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v7 | |
| - name: Node Modules Cache | |
| uses: actions/cache@v5 | |
| with: | |
| path: node_modules | |
| key: ${{ runner.os }}-${{ hashFiles('bun.lock') }} | |
| - name: Checkout nodejs | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: '24.15.0' | |
| registry-url: 'https://registry.npmjs.org' | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: '1.3.13' | |
| - name: Update NPM | |
| run: npm i -g npm@11.16.0 | |
| - name: Install Deps | |
| run: bun ci | |
| - name: Build | |
| working-directory: ./lib/distopia | |
| run: bun run build | |
| - name: Publish | |
| working-directory: ./lib/distopia | |
| run: npx jsr publish ${{ github.event_name == 'pull_request' && '--dry-run' || '' }} |