Publish #13
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: publish | |
run-name: Publish | |
on: | |
push: | |
branches: | |
- "main" | |
permissions: | |
contents: write | |
packages: write | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: NPM install | |
run: npm ci | |
- name: Build Storybook | |
run: npm run build:storybook | |
- name: Deploy Storybook | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
folder: storybook-static | |
- name: Deploy NPM | |
uses: JS-DevTools/npm-publish@v3 | |
with: | |
access: public | |
token: ${{ secrets.NPM_TOKEN }} | |
- name: Get package.json version | |
uses: martinbeentjes/npm-get-version-action@v1.3.1 | |
id: get-package-version | |
- name: Create a release | |
run: gh release create -t ${{ steps.get-package-version.outputs.current-version }} ${{ steps.get-package-version.outputs.current-version }} --generate-notes | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |