Skip to content

Instantly share code, notes, and snippets.

@Mattamorphic
Last active August 22, 2020 18:34
Show Gist options
  • Save Mattamorphic/792c2f1975c7f96065b9f9fc94311218 to your computer and use it in GitHub Desktop.
Save Mattamorphic/792c2f1975c7f96065b9f9fc94311218 to your computer and use it in GitHub Desktop.
NPM Publish GitHub Package Registry
name: Deploy package to GitHub package registry
on:
pull_request:
branches:
- master
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: "Setup actions"
uses: actions/checkout@v1
- name: "npm/registry setup"
uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://npm.pkg.github.com/
scope: "@OWNER"
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: "publish package"
uses: actions/bin/debug@master
run: |
npm run test
npm run build
echo registry=https://npm.pkg.github.com/OWNER >> .npmrc
npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment