Repository navigation
57 lines (57 loc) · 2.04 KB
/
Copy pathstorybook.yml
File metadata and controls
57 lines (57 loc) · 2.04 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
name: Create StoryBook Page
on:
push:
branches:
- master
jobs:
VisualTest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: main:Cache node modules(yarn.lock)
id: cache
uses: actions/cache@v1
with:
path: main/node_modules
key: ${{ runner.OS }}-build-${{ hashFiles('main/yarn.lock') }}
restore-keys: ${{ runner.OS }}-build-${{ env.cache-name }}-
- name: main:package-install
if: steps.cache.outputs.cache-hit != 'true'
run: yarn --cwd main
- name: main:build
run: yarn --cwd main build
- name: test:Cache node modules(yarn.lock)
id: test-cache
uses: actions/cache@v1
with:
path: test/node_modules
key: ${{ runner.OS }}-build-test-${{ hashFiles('test/yarn.lock') }}
restore-keys: ${{ runner.OS }}-build-${{ env.cache-name }}-
- name: test:package-install
if: steps.test-cache.outputs.cache-hit != 'true'
run: yarn --cwd test
- name: build storybook
run: yarn --cwd test build
- name: Create gh-pages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN}}
run: |
git clone https://github.com/${GITHUB_REPOSITORY} -b gh-pages __gh-pages__ || mkdir -p __gh-pages__
rm -rf __gh-pages__/storybook-static || true
mv test/storybook-static __gh-pages__
- name: Save gh-pages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN}}
run: |
cd __gh-pages__
if [ ! -d .git ]; then
git init
git checkout -b gh-pages
git remote add origin https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/$GITHUB_REPOSITORY
fi
git remote set-url origin https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/$GITHUB_REPOSITORY
git config --global user.name $GITHUB_ACTOR
git config --global user.email ${GITHUB_ACTOR}@git
git add .
git commit -m $GITHUB_REF
git push origin gh-pages