mirror of
https://github.com/kremalicious/astro-redirect-from.git
synced 2024-12-23 01:39:45 +01:00
47 lines
879 B
YAML
47 lines
879 B
YAML
name: 'CI'
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
tags:
|
|
- '**'
|
|
pull_request:
|
|
branches:
|
|
- '**'
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
node: ['18', '20']
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: actions/setup-node@v3
|
|
with:
|
|
node-version: ${{ matrix.node }}
|
|
|
|
- run: npm ci
|
|
- run: npm test
|
|
- run: npm run build
|
|
|
|
publish:
|
|
needs: test
|
|
if: success() && startsWith(github.ref, 'refs/tags')
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: actions/setup-node@v3
|
|
with:
|
|
registry-url: 'https://registry.npmjs.org'
|
|
|
|
- run: npm ci
|
|
- run: npm publish
|
|
env:
|
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|