Skip to content

Merge branch 'beta' into 80-empty-author-shows-empty-initials #781

Merge branch 'beta' into 80-empty-author-shows-empty-initials

Merge branch 'beta' into 80-empty-author-shows-empty-initials #781

Workflow file for this run

name: build and deploy
env:
NODE_VERSION: "20"
on: [push]
jobs:
lint:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Run formater and linter
run: npm run lint
build:
runs-on: ubuntu-latest
needs: lint
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: "npm"
- run: npm ci # install dependencies
- run: npm run build # build library
- run: npm run build-storybook # build docs
- name: upload library artifacts
uses: actions/upload-artifact@v4
with:
name: library_dist
path: ./dist
- name: upload storybook artifacts
uses: actions/upload-artifact@v4
with:
name: storybook_dist
path: ./storybook-static
deploy-npm:
runs-on: ubuntu-latest
needs: build
permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
id-token: write # to enable use of OIDC for npm provenance
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/beta'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: "npm"
- run: npm ci # install dependencies
- name: Download build-results
uses: actions/download-artifact@v4
with:
name: library_dist
path: ./dist
- name: run semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm run semantic-release
deploy-gh-pages:
runs-on: ubuntu-latest
needs: build
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
contents: write
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
if: github.ref == 'refs/heads/main'
steps:
- name: Download build-results
uses: actions/download-artifact@v4
with:
name: storybook_dist
path: ./storybook-static
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
id: deployment
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./storybook-static