Skip to content

Commit 13b28fb

Browse files
authored
Merge pull request #63 from binh-dam-ibigroup/github-actions
Replace Travis with GitHub actions
2 parents 3d8c11d + ddeea28 commit 13b28fb

File tree

4 files changed

+71
-30
lines changed

4 files changed

+71
-30
lines changed

.github/workflows/codespell.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# GitHub Action to automate the identification of common misspellings in text files.
2+
# https://github.com/codespell-project/actions-codespell
3+
# https://github.com/codespell-project/codespell
4+
name: codespell
5+
on: pull_request
6+
jobs:
7+
codespell:
8+
name: Check for spelling errors
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- uses: codespell-project/actions-codespell@master
13+
with:
14+
check_filenames: true
15+
only_warn: 1
16+
skip: ./.git,yarn.lock,./stories/data/*

.github/workflows/node-ci.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Node.js CI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
9+
jobs:
10+
test-build-release:
11+
env:
12+
IS_PUSH_TO_MASTER: ${{ github.event.push && github.ref == 'refs/heads/master' }}
13+
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v2
18+
- name: Use Node.js 12.x
19+
uses: actions/setup-node@v1
20+
with:
21+
node-version: 12.x
22+
- name: Install npm packages using cache
23+
uses: bahmutov/npm-install@v1
24+
- name: Lint code
25+
run: yarn lint
26+
- name: Run tests with coverage
27+
run: yarn cover
28+
29+
# at this point, the build is successful
30+
- name: Codecov
31+
uses: codecov/[email protected]
32+
continue-on-error: true
33+
- name: Semantic Release
34+
env:
35+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
36+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
37+
run: yarn semantic-release
38+
39+
# Steps below deal with uploading Storybook to S3,
40+
# which is only performed with a push to the main branch.
41+
# Note that AWS CLI v2 is already installed by default on GitHub's Ubuntu 20.04.
42+
# per https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-README.md#cli-tools.
43+
- name: Add AWS credentials
44+
if: ${{ env.IS_PUSH_TO_MASTER }}
45+
run: mkdir ~/.aws && printf '%s\n' '[default]' "aws_access_key_id=$AWS_ACCESS_KEY_ID" "aws_secret_access_key=$AWS_SECRET_ACCESS_KEY" "region=$AWS_REGION" > ~/.aws/config
46+
env:
47+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
48+
AWS_REGION: ${{ secrets.AWS_REGION }}
49+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
50+
# Deploy storybook demo to S3 if handling a push (non-PR build) on the main branch
51+
# https://s3.amazonaws.com/transitive.js/index.html
52+
- name: Deploy storybook to S3
53+
if: ${{ env.IS_PUSH_TO_MASTER }}
54+
run: yarn deploy-storybook

.travis.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"prepublish": "mastarm prepublish lib:build",
3131
"cover": "npm test -- --coverage",
3232
"lint": "mastarm lint lib",
33-
"semantic-release": "semantic-release pre && npm publish && semantic-release post",
33+
"semantic-release": "semantic-release",
3434
"start": "start-storybook -p 5555",
3535
"deploy-storybook": "storybook-to-aws-s3 --bucket-path=transitive.js --s3-sync-options=--acl=public-read"
3636
},

0 commit comments

Comments
 (0)