Baseline deployment on chromatic #380
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# .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 }} |