mirror of
https://github.com/curlconverter/curlconverter.git
synced 2022-05-22 02:35:29 +03:00
51 lines
1.2 KiB
YAML
51 lines
1.2 KiB
YAML
name: Node.js CI
|
|
|
|
on:
|
|
push:
|
|
branches: [master]
|
|
pull_request:
|
|
branches: [master]
|
|
|
|
jobs:
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: actions/setup-node@v3
|
|
with:
|
|
node-version: "16"
|
|
- run: npm install
|
|
- run: npm run lint
|
|
- run: npx prettier --check .
|
|
|
|
test:
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
matrix:
|
|
# Tests fail to run on Windows, see
|
|
# https://github.com/curlconverter/curlconverter/pull/310
|
|
os: [ubuntu-latest]
|
|
node-version: [12, 14, 16]
|
|
fail-fast: false
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
- run: npm install
|
|
- run: npm test
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
needs: test
|
|
if: github.event_name == 'push' && github.repository_owner == 'curlconverter'
|
|
steps:
|
|
- name: Deploy demo site
|
|
uses: peter-evans/repository-dispatch@v2
|
|
with:
|
|
token: ${{ secrets.REPO_ACCESS_TOKEN }}
|
|
repository: curlconverter/curlconverter.github.io
|
|
event-type: ship-it
|