generated from itsjavi/template-react-component-library
-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (58 loc) · 1.97 KB
/
publish-main.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: Release new stable version (main)
on:
push:
branches: [main]
concurrency: release-new-version
permissions:
contents: write
pages: write
id-token: write
packages: write
actions: write
pull-requests: write
jobs:
releaseNewVersion:
name: "Release new version"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "Setup Project"
uses: ./.github/actions/setup-project
- name: "Check code quality"
uses: ./.github/actions/check-code-quality
# - name: "Authenticate with GitHub package registry (publish)"
# run: echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" > ~/.npmrc
- name: "Prepare git"
run: |
git config --global user.email "[email protected]"
git config --global user.name "github-actions"
git branch -u origin/main main
- name: "Increase build versions"
run: pnpm release --tag-prefix --commit-all
# Uncomment when we have a package to publish
- name: "Publish package"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_CONFIG_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: pnpm publish --no-git-checks
- name: "Push new version to git"
run: |
git add .
git push --follow-tags
publishStorybook:
name: "Publish Storybook to GitHub Pages"
runs-on: ubuntu-latest
needs: [releaseNewVersion]
steps:
- uses: actions/checkout@v4
- name: "Setup Project"
uses: ./.github/actions/setup-project
- name: "Build storybook"
run: pnpm build:storybook
- uses: ./.github/actions/deploy-storybook
with:
install_command: pnpm install # default: npm ci
build_command: pnpm build:storybook # default: npm run build-storybook
path: storybook-static # default: dist/storybook
checkout: false # default: true