shareon-pulsanti-condivisio.../.github/workflows/ci.yml

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

64 lines
1.4 KiB
YAML
Raw Normal View History

2021-01-16 22:10:57 +01:00
name: Node.js CI
on:
push:
branches:
2021-01-16 23:02:36 +01:00
- main
2021-01-16 22:10:57 +01:00
- v*
pull_request:
branches:
2021-01-16 23:02:36 +01:00
- main
2021-01-16 22:10:57 +01: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:
2022-02-02 15:19:03 +01:00
node-version: "16"
- uses: pnpm/action-setup@v2.0.1
with:
version: 6.0.2
2021-01-16 22:10:57 +01:00
- name: Install dependencies
2022-02-02 15:19:03 +01:00
run: pnpm i
2021-01-16 22:10:57 +01:00
- name: Lint
2022-02-02 15:19:03 +01:00
run: pnpm run lint
2021-01-16 22:10:57 +01:00
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:
2022-02-02 15:19:03 +01:00
node-version: "16"
- uses: pnpm/action-setup@v2.0.1
with:
version: 6.0.2
2021-01-16 22:10:57 +01:00
- name: Install dependencies
2022-02-02 15:19:03 +01:00
run: pnpm i
2021-01-16 22:10:57 +01:00
- name: Test package
2022-02-02 15:19:03 +01:00
run: pnpm run test
2021-01-16 22:10:57 +01:00
- name: Copy built files to docs
run: cp ./dist/shareon.min.* ./docs
2021-01-16 23:02:36 +01:00
if: ${{ github.ref == 'refs/heads/main' }}
2021-01-16 22:10:57 +01: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 23:02:36 +01:00
if: ${{ github.ref == 'refs/heads/main' }}
2021-01-16 22:10:57 +01:00
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}