Skip to content

Commit

Permalink
Merge 8ec608f into bd690e6
Browse files Browse the repository at this point in the history
  • Loading branch information
mcataford committed Aug 3, 2021
2 parents bd690e6 + 8ec608f commit 6ce24ae
Show file tree
Hide file tree
Showing 4 changed files with 161 additions and 32 deletions.
159 changes: 159 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
name: CICD
on:
push:
branches:
master
pull_request:

env:
NODE_VERSION: 14

jobs:
setup:
runs-on: ubuntu-latest
name: Setup
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
id: node-setup
with:
node-version: ${{ env.NODE_VERSION }}
- uses: actions/cache@v2
id: cache-restore
with:
path: |
node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-${{ env.NODE_VERSION }}
- name: Install dependencies
if: steps.cache-restore.outputs.cache-hit != 'true'
run: yarn
lint:
runs-on: ubuntu-latest
name: Lint
needs: setup
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
id: node-setup
with:
node-version: ${{ env.NODE_VERSION }}
- name: Yarn cache
uses: actions/cache@v2
id: yarn-cache-restore
with:
path: |
node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-${{ env.NODE_VERSION }}
- name: Lint
run: |
yarn
yarn lint
test:
runs-on: ubuntu-latest
name: Test
needs: setup
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
id: node-setup
with:
node-version: ${{ env.NODE_VERSION }}
- name: Yarn cache
uses: actions/cache@v2
id: yarn-cache-restore
with:
path: |
node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-${{ env.NODE_VERSION }}
- name: Tests
run: |
yarn
yarn coverage
yarn coveralls
build:
runs-on: ubuntu-latest
name: Build
needs: setup
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
id: node-setup
with:
node-version: ${{ env.NODE_VERSION }}
- name: Yarn cache
uses: actions/cache@v2
id: yarn-cache-restore
with:
path: |
node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-${{ env.NODE_VERSION }}
- run: |
yarn
yarn build
- name: Build Artifacts
uses: actions/upload-artifact@v2
with:
name: build-artifacts
path: dist
release:
runs-on: ubuntu-latest
name: Release
needs:
- build
- test
- lint
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
id: node-setup
with:
node-version: ${{ env.NODE_VERSION }}
- name: Yarn cache
uses: actions/cache@v2
id: yarn-cache-restore
with:
path: |
node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-${{ env.NODE_VERSION }}
- name: Build Artifacts
uses: actions/download-artifact@v2
with:
name: build-artifacts
path: dist
- name: Release (dry)
if: ${{ github.ref != 'refs/heads/master' }}
run: |
yarn
yarn semantic-release --ci --dry-run
- name: Release
if: ${{ github.ref == 'refs/heads/master' }}
run: |
yarn
yarn semantic-release --ci
website-deploy:
runs-on: ubuntu-latest
name: Website deploy
needs: setup
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
id: node-setup
with:
node-version: ${{ env.NODE_VERSION }}
- name: Yarn cache
uses: actions/cache@v2
id: yarn-cache-restore
with:
path: |
node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-${{ env.NODE_VERSION }}
- name: Deploy (dry)
if: ${{ github.ref != 'refs/heads/master' }}
run: |
yarn
yarn deploy:dryrun
- name: Deploy
if: ${{ github.ref == 'refs/heads/master' }}
run: |
yarn
yarn deploy
31 changes: 0 additions & 31 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# React-Intl-Tel-Input

[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)
[![Build Status](https://travis-ci.org/patw0929/react-intl-tel-input.svg)](https://travis-ci.org/patw0929/react-intl-tel-input)
[![CICD](https://github.com/patw0929/react-intl-tel-input/actions/workflows/main.yml/badge.svg)](https://github.com/patw0929/react-intl-tel-input/actions/workflows/main.yml)
[![npm version](https://badge.fury.io/js/react-intl-tel-input.svg)](http://badge.fury.io/js/react-intl-tel-input)
[![Coverage Status](https://coveralls.io/repos/github/patw0929/react-intl-tel-input/badge.svg?branch=master)](https://coveralls.io/github/patw0929/react-intl-tel-input?branch=master)
[![npm](https://img.shields.io/npm/l/express.svg?maxAge=2592000)]()
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@
"build": "BABEL_ENV=production babel src -d dist && cp -r ./src/*.png ./dist && node-sass ./src/intlTelInput.scss ./dist/main.css",
"clean": "rimraf dist",
"start": "start-storybook -p 4000 -c .storybook",
"deploy:dryrun": "storybook-to-ghpages --dry-run",
"deploy": "storybook-to-ghpages --ci",
"lint": "eslint src *.js",
"coverage": "yarn run test -- --coverage",
Expand Down

0 comments on commit 6ce24ae

Please sign in to comment.