Publish to NPM #253
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Publish to NPM" | |
on: | |
workflow_dispatch: | |
jobs: | |
publish-npm: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/cache@v3 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/package.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- uses: actions/cache@v3 | |
with: | |
path: ~/.cypress | |
key: ${{ runner.os }}-cypress-${{ hashFiles('**/cypress.json') }} | |
restore-keys: | | |
${{ runner.os }}-cypress- | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
registry-url: https://registry.npmjs.org | |
- run: npm ci | |
env: | |
CI: true | |
CYPRESS_CACHE_FOLDER: '~/.cypress' | |
- name: Publish to NPM registry | |
run: npm publish --access public | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} |