👷 Added GitHub Actions workflow for CI/CD

This commit is contained in:
Thomas Müller
2025-04-29 13:43:47 +02:00
parent 25353662ec
commit 1dc94c0dd1
+49
View File
@@ -0,0 +1,49 @@
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- run: npm ci
- run: npm run build
- run: npm run check
- run: npm run test:ci
- run: npm run check:outdated
- run: npm run check:cspell
- run: npm run check:tsc
- run: npm run check:eslint
- run: npm run check:prettier
- run: npm run check:package
- name: Upload coverage
uses: actions/upload-artifact@v4
with:
name: coverage
path: coverage
publish:
if: startsWith(github.ref, 'refs/tags/')
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: 'https://registry.npmjs.org/'
- run: npm ci
- run: npm run build
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}