Last active
September 10, 2021 04:12
-
-
Save Luke-SNAW/4b3f2b7b88a1013167c2959a61a7c306 to your computer and use it in GitHub Desktop.
[github actions: test build on pull request] #github
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: 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