2021-01-16 16:10:57 -05:00
|
|
|
name: Node.js CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2021-01-16 17:02:36 -05:00
|
|
|
- main
|
2021-01-16 16:10:57 -05:00
|
|
|
- v*
|
|
|
|
pull_request:
|
|
|
|
branches:
|
2021-01-16 17:02:36 -05:00
|
|
|
- main
|
2021-01-16 16:10:57 -05:00
|
|
|
|
|
|
|
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
|
2021-01-16 17:02:36 -05:00
|
|
|
if: ${{ github.ref == 'refs/heads/main' }}
|
2021-01-16 16:10:57 -05:00
|
|
|
- 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
|
2021-01-16 17:02:36 -05:00
|
|
|
if: ${{ github.ref == 'refs/heads/main' }}
|
2021-01-16 16:10:57 -05:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|