Skip to content

Commit

Permalink
🔧 Add npm publish workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
macdonst committed Nov 13, 2020
1 parent bbff9ab commit 059a27a
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflow/npm-publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: NPM publish CD workflow

name: npm-publish
on:
push:
tags:
- '*'

jobs:
npm-publish:
# Run on latest version of ubuntu
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
# install Node.js
- name: Use Node.js 12
uses: actions/setup-node@v1
with:
node-version: 12
# Specifies the registry, this field is required!
registry-url: https://registry.npmjs.org/
- run: npm install -g yarn
# clean install of your projects' deps. We use "npm ci" to avoid package lock changes
- run: yarn install
# build the project
- run: yarn run build
# run tests just in case
- run: yarn run test
# publish to NPM -> there is one caveat, continue reading for the fix
- run: npm publish
env:
# Use a token to publish to NPM. See below for how to set it up
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 comments on commit 059a27a

Please sign in to comment.