-
Notifications
You must be signed in to change notification settings - Fork 9
47 lines (44 loc) · 1.84 KB
/
baseline.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
# .github/workflows/baseline.yml
# Workflow name
name: 'Baseline deployment on chromatic'
# Event for the workflow
on: create
jobs:
create-subtheme-baseline-master:
runs-on: ubuntu-latest
if: |
github.event.ref_type == 'branch'
&& contains(github.event.ref, '#')
&& contains(github.event.ref, 'chore/release')
steps:
- uses: actions/checkout@v2
with:
ref: master
fetch-depth: 0
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Get project to be deployed
shell: bash
run: echo "##[set-output name=branch;]$(grep -oP '(?<=#).*?(?=#)' <<< ${{ github.event.ref }})"
id: extract_branch
- name: Publish to Chromatic
run: yarn chromatic --ci --force-rebuild --auto-accept-changes --project-token=${{ secrets.CHROMATIC_PROJECT_TOKEN }} --build-script-name=build:chromatic:${{ steps.extract_branch.outputs.branch }} --branch-name=${{ github.event.ref }}
create-subtheme-baseline-development:
runs-on: ubuntu-latest
if: |
github.event.ref_type == 'branch'
&& contains(github.event.ref, '#')
&& !contains(github.event.ref, 'chore/release')
steps:
- uses: actions/checkout@v2
with:
ref: development
fetch-depth: 0
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Get project to be deployed
shell: bash
run: echo "##[set-output name=branch;]$(grep -oP '(?<=#).*?(?=#)' <<< ${{ github.event.ref }})"
id: extract_branch
- name: Publish to Chromatic
run: yarn chromatic --ci --force-rebuild --auto-accept-changes --project-token=${{ secrets.CHROMATIC_PROJECT_TOKEN }} --build-script-name=build:chromatic:${{ steps.extract_branch.outputs.branch }} --branch-name=${{ github.event.ref }}