-
Notifications
You must be signed in to change notification settings - Fork 5
46 lines (42 loc) · 1.42 KB
/
real-life-use-case.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
name: 'Build and deploy only on PR with label'
on:
pull_request:
types: [labeled, unlabeled, opened, edited, closed, synchronize]
branches:
- force-real-life-usecase
jobs:
real-life:
if: |
contains(github.event.pull_request.labels.*.name, 'storybook')
runs-on: ubuntu-latest
name: Deploy storybook
steps:
- uses: actions/checkout@v2
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
if: github.event.action != 'closed'
- uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-v1-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-v1-
if: github.event.action != 'closed'
- name: Install deps checking cache hit
run: yarn install --frozen-lockfile
if: github.event.action != 'closed'
# This is how you'll use the action
- name: build -> deploy storybook
uses: ./ # Replace here with sauloxd/review-apps@X.X.X
with:
branch: "review-apps"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
apps: |
{
"storybook": {
"build": "yarn run cra:storybook",
"dist": "packages/cra-example/storybook-static"
}
}