Move storybook folder #37
Workflow file for this run
This file contains 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: CI | |
on: [push] | |
jobs: | |
ci: | |
runs-on: ubuntu-latest | |
permissions: | |
pages: write | |
id-token: write | |
steps: | |
- uses: pnpm/action-setup@v4 | |
with: | |
version: 8 | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 2 | |
- run: pnpm install | |
- run: pnpm lint | |
- run: pnpm format:check | |
- run: pnpm test | |
working-directory: packages/zod-error-viewer | |
- run: pnpm build | |
working-directory: packages/zod-error-viewer | |
- name: Publish package | |
working-directory: packages/zod-error-viewer | |
run: | | |
if [ $GITHUB_REF != "refs/heads/main" ]; then | |
echo "Branch is not main, skipping publish step" | |
exit 0 | |
fi | |
echo "Branch is main, proceeding..." | |
prev_version=$(git show HEAD~1:package.json | jq -r '.version') | |
new_version=$(cat package.json | jq -r '.version') | |
if [ $prev_version = $new_version ]; then | |
echo "Version has not changed, skipping publish step" | |
exit 0 | |
fi | |
echo "Version was changed from ${prev_version} to ${new_version}, proceeding with publish step..." | |
echo "Setting auth token..." | |
pnpm config set //registry.npmjs.org/:_authToken ${{ secrets.NPM_TOKEN }} | |
echo "Set auth token" | |
echo "Publishing package..." | |
pnpm publish | |
- name: Build documentation | |
run: pnpm build-storybook | |
working-directory: packages/zod-error-viewer | |
- name: Upload documentation artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: packages/zod-error-viewer/storybook-static | |
- name: Publish documentation | |
uses: actions/deploy-pages@v4 |