This repository has been archived by the owner on Mar 25, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
90 lines (75 loc) · 2.43 KB
/
build_and_deploy_preview.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: Build and deploy preview
on: push
jobs:
build_and_deploy_preview:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip ci]')"
env:
NOTIFY_WEBHOOK: ${{ secrets.NOTIFY_WEBHOOK }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # required by Chromatic
# Start a timer and set the preamble for the notification
- uses: ./.github/actions/notifier-start
if: always() && !env.ACT
# Use Node 15 for now, but it's not LTS
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: 15.x
# Setup
- name: Setup ACT debugging container
if: ${{ env.ACT }}
run: ./.ci/debug/setup_debugging.sh
- name: Setup Tooling
id: setup
run: ./setup.sh
# Install
- uses: actions/cache@v1
with:
path: /home/runner/yarn-cache
key: yarncache
- name: Install Packages
id: install
run: ./.ci/install.sh
env:
YARN_CACHE_FOLDER: /home/runner/yarn-cache
# For debugging only, but must be defined here or `act` ignores it
BREAK_INTERACTIVE_BEFORE_INSTALL: ${{ secrets.BREAK_INTERACTIVE_BEFORE_INSTALL }}
# Lint
- name: Lint
id: lint
run: .ci/lint.sh
# Typecheck
- uses: actions/cache@v1
with:
path: ${github.workspace}/dist
key: typecache
- name: Typecheck
id: typecheck
run: .ci/typecheck.sh
# Static analysis
- name: "Statically Analyze Code"
id: analysis
run: .ci/analyze_static.sh
# Build
- name: Build Static Website
id: build
# Temporary: Builds take forever. Make them opt in with a pragma.
if: "contains(github.event.head_commit.message, '[build]')"
run: ./.ci/build.sh
env:
DOCSEARCH_PUBLIC_CLIENT_API_KEY: ${{ secrets.DOCSEARCH_PUBLIC_CLIENT_API_KEY }}
# Chromatic
- name: Upload Storybook to Chromatic
id: chromatic
run: ./.ci/chromatic.sh
env:
CHROMATIC_PROJECT_TOKEN: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
# Stop the timer, format the message, and send the notification
- uses: ./.github/actions/notifier-complete
if: always() && !env.ACT
with:
job_status: ${{ job.status }}
parent_steps: "${{ toJSON(steps) }}"