Skip to content
name: Publish Styleguide
on:
release:
types: [published]
defaults:
run:
working-directory: styleguide
jobs:
build:
runs-on: self-hosted
if: ${{ startsWith(github.ref, 'refs/tags/styleguide@') }}
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.PAT_COMMIT_MAIN }}
ref: main
- uses: actions/setup-node@v2
with:
node-version: "14.x"
registry-url: 'https://registry.npmjs.org'
- name: Install deps and build (with cache)
uses: bahmutov/npm-install@v1
with:
working-directory: styleguide
- name: Update version
run: yarn version --new-version "${GITHUB_REF#refs/tags/styleguide@}" --no-git-tag-version
working-directory: styleguide
- name: Publish to NPM
run: yarn publish --access public
working-directory: styleguide
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN_STYLEGUIDE }}
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Published tag for Styleguide
branch: main
push_options: --force
file_pattern: styleguide/package.json
- name: Send to GitHub Pages 🔧
run: yarn deploy-storybook --ci --source-branch=main
working-directory: styleguide
env:
GH_TOKEN: ${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}