Run GHA build on tags too #6
Workflow file for this run
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
on: | |
push: | |
branches: | |
- master | |
tags: | |
- v* | |
pull_request: | |
branches: | |
- master | |
workflow_dispatch: | |
jobs: | |
buildAndPublish: | |
name: Build and publish to NPM (GH) | |
runs-on: ubuntu-22.04 | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
cache: 'yarn' | |
registry-url: https://npm.pkg.github.com | |
- name: Install dependencies | |
run: yarn --frozen-lockfile | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build | |
run: yarn build | |
- name: Release | |
if: ${{ github.event_name == 'push' && github.ref_type == 'tag' }} | |
run: yarn release | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Notify Google Chat | |
uses: evidenceprime/google-chat-notifications@master | |
if: ${{ always() && github.event_name == 'push' }} | |
with: | |
title: "Buffer" | |
subtitle: ${{ github.event.head_commit.message }} | |
webhookUrl: ${{ secrets.GOOGLE_CHAT_WEBHOOK_URL }} | |
threadKey: QexDHE9oqjI | |
status: ${{ job.status }} |