Skip to content

Commit

Permalink
ci(Action): Use github action instead of travis
Browse files Browse the repository at this point in the history
  • Loading branch information
Belphemur committed Apr 8, 2021
1 parent 0035ff1 commit 1701376
Showing 1 changed file with 81 additions and 0 deletions.
81 changes: 81 additions & 0 deletions .github/workflows/nodejs.yml
@@ -0,0 +1,81 @@
name: NodeJs
on:
push:
pull_request:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node: [ '12', '14' ]
steps:
- uses: actions/checkout@v2
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Setup Node.js ${{ matrix.node }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- name: Install dependencies
run: yarn ci
- name: Run tests
run: yarn test
deploy-pages:
needs: build
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 14
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Install semantic-release dependencies
run: yarn ci
- name: Build package
run: yarn build:doc
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@4.1.1
with:
branch: gh-pages # The branch the action should deploy to.
folder: docs # The folder the action should deploy.

release:
needs: build
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 14
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Install semantic-release dependencies
run: yarn ci
- name: Build package
run: yarn build
- name: Release
run: yarn semantic-release

0 comments on commit 1701376

Please sign in to comment.