Skip to content

Release

Release #197

Workflow file for this run

name: Release
on: workflow_dispatch
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- name: Setup
uses: actions/setup-node@v4
with:
cache: yarn
node-version: 20
- name: Install
run: yarn install --frozen-lockfile
- name: Build
run: yarn build
- name: Release
run: yarn semantic-release
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
# TODO Check if both are really needed.
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
NODE_AUTH_TOKEN: ${{ secrets.GH_PAT }}
- name: Get version
id: get_version
run: echo ::set-output name=version::$(npm pkg get version | sed 's/"//g')
- name: Create pull request
uses: peter-evans/create-pull-request@v5
with:
branch: ci-release-v${{ steps.get_version.outputs.version }}
# https://docs.github.com/en/actions/managing-workflow-runs/skipping-workflow-runs
commit-message: 'ci(release): ${{ steps.get_version.outputs.version }}'
title: 'ci(release): ${{ steps.get_version.outputs.version }}'
token: ${{ secrets.GH_PAT }}
deploy:
name: Deploy
needs: release
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup
uses: actions/setup-node@v4
with:
cache: yarn
node-version: 20
- name: Install
run: yarn install --frozen-lockfile
- name: Build
run: yarn build:storybook
- name: Deploy
run: |
git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
npx gh-pages -d storybook-static -u "github-actions-bot <[email protected]>"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}