Skip to content

Commit

Permalink
Merge pull request #2 from binh-dam-ibigroup/fix-master-actions
Browse files Browse the repository at this point in the history
Fix master actions
  • Loading branch information
binh-dam-ibigroup authored Mar 25, 2021
2 parents 3d8c11d + 23a8d36 commit 5f2010d
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 30 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# GitHub Action to automate the identification of common misspellings in text files.
# https://github.com/codespell-project/actions-codespell
# https://github.com/codespell-project/codespell
name: codespell
on: pull_request
jobs:
codespell:
name: Check for spelling errors
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: codespell-project/actions-codespell@master
with:
check_filenames: true
only_warn: 1
skip: ./.git,yarn.lock,./stories/data/*
56 changes: 56 additions & 0 deletions .github/workflows/node-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Node.js CI

on:
push:
branches:
- master
pull_request:

jobs:
test-build-release:
env:
GIT_BRANCH_NAME: ${{ github.ref }}
IS_PUSH: ${{ github.event.push }}
IS_PUSH_TO_MASTER: ${{ github.event.push && github.ref == 'refs/heads/master' }}

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Use Node.js 12.x
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Install npm packages using cache
uses: bahmutov/npm-install@v1
- name: Lint code
run: yarn lint
- name: Run tests with coverage
run: yarn cover

# at this point, the build is successful
- name: Codecov
uses: codecov/[email protected]
continue-on-error: true
- name: Semantic Release
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: yarn semantic-release

# Steps below deal with uploading Storybook to S3,
# which is only performed with a push to the main branch.
# Note that AWS CLI v2 is already installed by default on GitHub's Ubuntu 20.04.
# per https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-README.md#cli-tools.
- name: Add AWS credentials
if: ${{ env.IS_PUSH_TO_MASTER }}
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
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_REGION: ${{ secrets.AWS_REGION }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# Deploy storybook demo to S3 if handling a push (non-PR build) on the main branch
# https://s3.amazonaws.com/transitive.js/index.html
- name: Deploy storybook to S3
if: ${{ env.IS_PUSH_TO_MASTER }}
run: yarn deploy-storybook
29 changes: 0 additions & 29 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"prepublish": "mastarm prepublish lib:build",
"cover": "npm test -- --coverage",
"lint": "mastarm lint lib",
"semantic-release": "semantic-release pre && npm publish && semantic-release post",
"semantic-release": "semantic-release",
"start": "start-storybook -p 5555",
"deploy-storybook": "storybook-to-aws-s3 --bucket-path=transitive.js --s3-sync-options=--acl=public-read"
},
Expand Down

0 comments on commit 5f2010d

Please sign in to comment.