Skip to content

Package publish workflow #29

Package publish workflow

Package publish workflow #29

Workflow file for this run

name: Basic Checks
on:
push:
branches:
- main
pull_request:
jobs:
build:
name: 'Lint 🧮, Test 🧪 and Build ⚒️'
runs-on: ubuntu-latest
steps:
- name: 'Checkout code'
uses: actions/checkout@v3
- name: 'Setup node'
uses: actions/setup-node@v3
with:
node-version: 20
- name: 'Install dependencies'
run: npm ci
- name: 'Run eslint'
run: npm run lint
- name: 'Run scss lint'
run: npm run lint-scss
- name: 'Run coverage unit test'
run: npm run test:coverage
- name: 'Run build'
run: npm run build
publish-npm:
name: 'Publish NPM 🚀'
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
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 publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
publish-gpr:
name: 'Publish GPR 📢'
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
needs: build
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://npm.pkg.github.com/
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.GPR_TOKEN}}