Skip to content

Commit

Permalink
build: migrate to Github Actions, fix script Storybook deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
antipin committed Dec 9, 2021
1 parent a9af8c6 commit 886faaa
Show file tree
Hide file tree
Showing 5 changed files with 143 additions and 136 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ workflows:
ignore:
- gh-pages
tags:
only: /^[0-9]+\.[0-9]+\.[0-9]+$/
only: //
- test:
requires:
- install
Expand Down
21 changes: 21 additions & 0 deletions .github/actions/npm-cache/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: NPM Cache
description: This action cancels prev runs, sets up Node, and sets up npm cache.
author: Alex Antipin <antipin@textkernel.nl>
runs:
using: 'composite'
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.9.1
with:
access_token: ${{ github.token }}
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '14'
- name: Cache node_modules
uses: actions/cache@v2
with:
path: ./node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node_modules-
40 changes: 40 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Check
on:
push:
branches:
- '*'
- '!gh-pages'
jobs:
install:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/npm-cache/
- run: npm install --prefer-offline --ignore-scripts --no-audit
shell: bash

test:
needs: install
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/npm-cache/
- run: npm run test:coverage -- -w 1 # set max workers to 1
- uses: coverallsapp/github-action@v1.1.2
with:
github-token: ${{ github.token }}
build:
needs: install
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/npm-cache/
- run: npm run build:prod
lint:
needs: install
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/npm-cache/
- run: npm run lint:ci
- run: npm run lint:styles
15 changes: 15 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Deploy
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/npm-cache/
- name: Deploy storybook to Github Pages
run: npm run storybook:deploy -- --ci
env:
GH_TOKEN: Textkernel:${{ secrets.GITHUB_TOKEN }}

0 comments on commit 886faaa

Please sign in to comment.