mirror of
https://github.com/remnawave/node.git
synced 2026-07-01 13:45:07 +00:00
87 lines
2.5 KiB
YAML
87 lines
2.5 KiB
YAML
name: Deploy lib
|
|
on:
|
|
push:
|
|
paths:
|
|
- 'libs/**/package.json'
|
|
- '.github/workflows/deploy-lib.yml'
|
|
|
|
jobs:
|
|
send-start-deploy-telegram-message:
|
|
name: Send Telegram message
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout source code
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Send Telegram message
|
|
uses: appleboy/telegram-action@master
|
|
with:
|
|
to: ${{ secrets.TELEGRAM_CHAT_ID }}
|
|
token: ${{ secrets.TELEGRAM_TOKEN }}
|
|
message: |
|
|
🏹 Deploy ${{ github.REPOSITORY }} npm package has started
|
|
commit message: ${{ github.event.head_commit.message }}
|
|
author: ${{ github.event.head_commit.author.name }}
|
|
commit timestamp: ${{ github.event.head_commit.timestamp }}
|
|
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
id-token: write
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Setup Node
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: '24.x'
|
|
registry-url: 'https://registry.npmjs.org'
|
|
|
|
- name: Update npm
|
|
run: npm install -g npm@latest
|
|
|
|
- name: Install dependencies and build
|
|
working-directory: './libs/contract'
|
|
run: npm i && npm run prepublish
|
|
|
|
- name: Publish package on NPM
|
|
working-directory: './libs/contract'
|
|
run: npm publish --access public
|
|
|
|
send-telegram-message:
|
|
name: Send Telegram message
|
|
needs: [build]
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout source code
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Send Telegram message
|
|
uses: appleboy/telegram-action@master
|
|
with:
|
|
to: ${{ secrets.TELEGRAM_CHAT_ID }}
|
|
token: ${{ secrets.TELEGRAM_TOKEN }}
|
|
message: |
|
|
✅ ${{ github.REPOSITORY }} npm package published
|
|
image tag: *${{ github.sha }}*
|
|
commit message: ${{ github.event.head_commit.message }}
|
|
author: ${{ github.event.head_commit.author.name }}
|
|
commit timestamp: ${{ github.event.head_commit.timestamp }}
|
|
|
|
notify-on-error:
|
|
runs-on: ubuntu-latest
|
|
needs: [build]
|
|
if: failure()
|
|
steps:
|
|
- name: Checkout source code
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Send error notification
|
|
uses: appleboy/telegram-action@master
|
|
with:
|
|
to: ${{ secrets.TELEGRAM_CHAT_ID }}
|
|
token: ${{ secrets.TELEGRAM_TOKEN }}
|
|
message: |
|
|
❌ ${{ github.REPOSITORY }} deploy NPM package failed.
|