-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: migrate to Github Actions, fix script Storybook deployment
- Loading branch information
Showing
5 changed files
with
143 additions
and
136 deletions.
There are no files selected for viewing
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
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
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- |
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
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 |
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
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 }} |
Oops, something went wrong.