Skip to content

Merge pull request #479 from thematters/develop #173

Merge pull request #479 from thematters/develop

Merge pull request #479 from thematters/develop #173

Workflow file for this run

name: Publish
on:
push:
branches:
- master
- develop
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
jobs:
build_and_publish:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@master
- name: Setup Node.js
uses: actions/setup-node@v2.1.4
with:
node-version: '16.14'
registry-url: 'https://registry.npmjs.org'
always-auth: true
- name: Cache Dependencies
id: cache
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install Dependencies
run: npm ci
- name: Test
run: npm run lint && npm run test
- name: Build
run: npm run build
# === `master` branch ===
- name: Publish to NPM
if: github.ref == 'refs/heads/master'
run: npm publish ./dist
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
- name: Slack Notification
if: always()
uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
author_name: matters-editor
fields: repo,message,commit,author,action,eventName,ref,workflow,job,took