-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (55 loc) · 1.73 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
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