-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (38 loc) · 1.32 KB
/
minify.yml
File metadata and controls
46 lines (38 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: Build and Minify
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '16'
# Удаляем опцию cache, которая вызывает ошибку
# cache: 'npm'
- name: Install dependencies
run: npm install
- name: Minify GStime.js
run: npm run build
- name: Commit minified file
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "Build: Minify GStime.js"
file_pattern: 'GStime.min.js'
- name: Send success message to Telegram
if: success()
run: |
curl -X POST "https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/sendMessage" \
-d chat_id="${{ secrets.TELEGRAM_CHAT_ID }}" \
-d text="🟢 $GITHUB_REPOSITORY [${{ github.event.pusher.name }}] - OK"
- name: Send error message to Telegram
if: failure()
run: |
curl -X POST "https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/sendMessage" \
-d chat_id="${{ secrets.TELEGRAM_CHAT_ID }}" \
-d text="🔴 $GITHUB_REPOSITORY [${{ github.event.pusher.name }}] - ERROR"