Release #293
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: Release | |
on: workflow_dispatch | |
jobs: | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 200 | |
persist-credentials: false | |
- name: Setup | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Install | |
uses: ./.github/actions/install | |
- 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@v6 | |
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 | |
permissions: | |
contents: read | |
id-token: write | |
pages: write | |
steps: | |
- name: Deploy | |
uses: bitovi/[email protected] | |
with: | |
install_command: yarn install --frozen-lockfile | |
build_command: yarn build:storybook:deploy | |
path: storybook-static | |
checkout: true |