Skip to content

Commit

Permalink
Added slack notification to github workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
vpmedia committed Jan 3, 2024
1 parent 8b3b233 commit 5f93447
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
27 changes: 18 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (c) 2023-present VPMedia
# author: Andras Csizmadia <andras@vpmedia.hu>

name: Node.js CI
name: Continuous Integration

on:
push:
Expand All @@ -11,21 +11,30 @@ on:

jobs:
build:

runs-on: ubuntu-22.04

strategy:
matrix:
node-version: [20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci --no-audit
- run: npm run lint
- run: npm run build
cache: "npm"
- name: Init
run: npm ci
- name: Lint
run: npm run lint
- name: Test
run: npm run test
- name: Slack notification
# https://github.com/slackapi/slack-github-action
id: slack
uses: slackapi/slack-github-action@v1.24.0
with:
channel-id: "dev-github"
slack-message: "${{ github.repository }}\n${{ github.workflow }} workflow is ${{ job.status }}\nRef: ${{ github.ref }}\nURL: ${{ github.event.pull_request.html_url || github.event.head_commit.url }}"
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
if: always()
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"stylelint": "stylelint \"**/*.css\"",
"typecheck": "tsc",
"format": "prettier --write \"**/*.{css,js,jsx,json,md}\"",
"test": "echo \"Error: no test specified\" && exit 1",
"test": "echo \"Warning: no test specified\" && exit 0",
"lefthook:install": "lefthook install",
"lefthook:uninstall": "lefthook uninstall"
},
Expand Down

0 comments on commit 5f93447

Please sign in to comment.