-
-
Notifications
You must be signed in to change notification settings - Fork 7
67 lines (58 loc) · 1.89 KB
/
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
name: Main CI
on:
workflow_dispatch:
inputs:
distTag:
description: "Dist tag to publish"
required: true
default: "latest"
pull_request:
push:
branches:
- "master"
jobs:
build_and_testing:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
BUNDLESIZE_GITHUB_TOKEN: ${{ secrets.BUNDLESIZE_GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false
- uses: actions/setup-node@v2-beta
with:
always-auth: true
node-version: 12
- name: Creates local .npmrc
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
- name: Cache .pnpm-store
uses: actions/cache@v1
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-node${{ matrix.node-version }}-${{ hashFiles('**/pnpm-lock.yaml') }}
- name: Install pnpm
run: curl -f https://get.pnpm.io/v6.16.js | node - add --global pnpm@6
- name: Install
run: pnpm install --frozen-lockfile
- name: Build & Testing
run: |
pnpm lint
pnpm build
pnpm test
pnpm bundle-size
- name: Release
if: ${{github.event.inputs.distTag == 'latest' || github.event.inputs.distTag == 'next'}}
run: |
git config --global user.email "[email protected]"
git config --global user.name "CI"
pnpm release && pnpm publish-storybook
- name: Release Docs
if: ${{github.event.inputs.distTag == 'latest' || github.event.inputs.distTag == 'next'}}
uses: JamesIves/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
BRANCH: gh-pages
FOLDER: example/storybook-static