This repository was archived by the owner on Jun 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 226
95 lines (91 loc) · 2.48 KB
/
cd.yml
File metadata and controls
95 lines (91 loc) · 2.48 KB
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: Continuous Delivery
on:
push:
branches:
- master
jobs:
build-and-test:
name: Build and Lint
runs-on: ubuntu-latest
outputs:
branch-name: ${{ steps.set-branch-name.outputs.branch-name }}
steps:
- uses: actions/setup-node@v2
with:
node-version: "12"
- uses: actions/checkout@v2
- uses: actions/cache@v2
id: yarn-cache
with:
path: |
**/node_modules
.yarn/cache
key: ${{ runner.os }}-modules-${{ hashFiles('yarn.lock') }}
- run: yarn install
if: steps.yarn-cache.outputs.cache-hit != 'true'
- run: yarn run build
- run: yarn run lint
- run: yarn run build-storybook
- uses: actions/upload-artifact@v2
with:
name: storybooks
path: |
storybook-static
- run: |
ref='${{ github.ref }}'
echo "::set-output name=branch-name::$(echo "${ref:11}")"
id: set-branch-name
publish-to-npm:
name: Publish to NPM
runs-on: ubuntu-latest
needs:
- build-and-test
steps:
- uses: actions/setup-node@v2
with:
node-version: "12"
registry-url: "https://registry.npmjs.org"
scope: "@rocket.chat"
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/cache@v2
id: yarn-cache
with:
path: |
**/node_modules
.yarn/cache
key: ${{ runner.os }}-modules-${{ hashFiles('yarn.lock') }}
- run: yarn install
if: steps.yarn-cache.outputs.cache-hit != 'true'
- run: yarn run build
- run: yarn publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
- run: yarn release -y
env:
GH_RELEASE_GITHUB_API_TOKEN: ${{ secrets.GH_TOKEN }}
publish-to-gh-pages:
name: Publish to GitHub Pages
runs-on: ubuntu-latest
needs:
- build-and-test
environment:
name: github-pages
steps:
- uses: actions/checkout@v2
with:
ref: gh-pages
- uses: actions/download-artifact@v2
with:
name: storybooks
path: |
storybook-static
- uses: crazy-max/ghaction-github-pages@v2
with:
target_branch: gh-pages
build_dir: "storybook-static"
commit_message: "Deploy to Github Pages [skip ci]"
jekyll: false
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}