Merge pull request #517 from thematters/feat/figure-new-line #206
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 | |
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: '18.19' | |
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 |