Simplify GH Action workflow
parent
39bd59b8eb
commit
334e3c5682
|
@ -0,0 +1,57 @@
|
||||||
|
name: Node.js CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
- v*
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
lint:
|
||||||
|
name: Lint package
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Setup Node
|
||||||
|
uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: '14'
|
||||||
|
- name: Install dependencies
|
||||||
|
run: yarn
|
||||||
|
- name: Lint
|
||||||
|
run: yarn lint
|
||||||
|
|
||||||
|
build-docs:
|
||||||
|
name: Build and test package and deploy docs
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Setup Node
|
||||||
|
uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: '14'
|
||||||
|
- name: Install dependencies
|
||||||
|
run: yarn
|
||||||
|
- name: Test package
|
||||||
|
run: yarn test
|
||||||
|
|
||||||
|
- name: Copy built files to docs
|
||||||
|
run: cp ./dist/shareon.min.* ./docs
|
||||||
|
if: ${{ github.ref == 'refs/heads/master' }}
|
||||||
|
- name: Deploy to GitHub Pages
|
||||||
|
uses: crazy-max/ghaction-github-pages@v2
|
||||||
|
with:
|
||||||
|
keep_history: true
|
||||||
|
build_dir: docs
|
||||||
|
fqdn: shareon.js.org
|
||||||
|
jekyll: false
|
||||||
|
if: ${{ github.ref == 'refs/heads/master' }}
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
@ -1,41 +0,0 @@
|
||||||
name: Node.js CI
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
- develop
|
|
||||||
- release/*
|
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
name: Node.js CI
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- name: Setup Node.js
|
|
||||||
uses: actions/setup-node@v1
|
|
||||||
with:
|
|
||||||
node-version: 14
|
|
||||||
- name: Install Yarn
|
|
||||||
uses: bahmutov/npm-install@v1.1.0
|
|
||||||
- name: Test
|
|
||||||
run: yarn test
|
|
||||||
|
|
||||||
- name: Copy built files to docs
|
|
||||||
run: cp ./dist/shareon.min.* ./docs
|
|
||||||
if: ${{ github.ref == 'refs/heads/master' }}
|
|
||||||
- name: Deploy to GitHub Pages
|
|
||||||
uses: crazy-max/ghaction-github-pages@v2.1.2
|
|
||||||
with:
|
|
||||||
keep_history: true
|
|
||||||
build_dir: docs
|
|
||||||
fqdn: shareon.js.org
|
|
||||||
jekyll: false
|
|
||||||
if: ${{ github.ref == 'refs/heads/master' }}
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
Loading…
Reference in New Issue