Skip to content

Commit

Permalink
Merge pull request #1012 from XiaoMi/feature/github-action
Browse files Browse the repository at this point in the history
chore: add github action
  • Loading branch information
solarjoker authored Mar 27, 2020
2 parents 5ffadf3 + fb6ae97 commit 44c65c9
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflow/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: deploy

on:
push:
branches:
- master

jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 10
- name: NPM Install and Test
run: |
npm install
npm run test
npm run compile
npm run build:gh-pages
- name: Publish
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
- name: Deploy to gh-pages
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
BRANCH: gh-pages
FOLDER: dist
22 changes: 22 additions & 0 deletions .github/workflow/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: test

on: [push]

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [10.x, 12.x]

steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: NPM Install and Test
run: |
npm install
npm run test

0 comments on commit 44c65c9

Please sign in to comment.