Skip to content

Instantly share code, notes, and snippets.

@Luke-SNAW
Last active September 10, 2021 04:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Luke-SNAW/4b3f2b7b88a1013167c2959a61a7c306 to your computer and use it in GitHub Desktop.
Save Luke-SNAW/4b3f2b7b88a1013167c2959a61a7c306 to your computer and use it in GitHub Desktop.
[github actions: test build on pull request] #github
name: Test on pull request
on:
workflow_dispatch:
pull_request:
branches: [dev]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x]
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- name: Install dependencies
run: npm ci
- name: generate
run: npm run generate
- name: build
run: npm run build
- name: Notify slack success
if: success()
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_NOTIFICATIONS_BOT_TOKEN }}
uses: voxmedia/github-action-slack-notify-build@v1
with:
channel: it-pr
status: SUCCESS
color: good
- name: Notify slack fail
if: failure()
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_NOTIFICATIONS_BOT_TOKEN }}
uses: voxmedia/github-action-slack-notify-build@v1
with:
channel: it-pr
status: FAILED
color: danger
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment