feat: dev build

This commit is contained in:
kastov 2025-08-09 00:41:26 +03:00
parent a6faf21f12
commit e5e64fac23
No known key found for this signature in database
GPG key ID: 1B27BE29057F4C90

106
.github/workflows/build-and-push-dev.yml vendored Normal file
View file

@ -0,0 +1,106 @@
name: Build and push dev
on:
push:
branches:
- dev
workflow_dispatch:
jobs:
send-start-deploy-telegram-message:
name: Send Telegram message
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Send Telegram message
uses: proDreams/actions-telegram-notifier@main
with:
token: ${{ secrets.TELEGRAM_TOKEN }}
chat_id: ${{ secrets.TELEGRAM_CHAT_ID }}
thread_id: ${{ secrets.TELEGRAM_TOPIC_ID }}
status: info
notify_fields: 'repository,branch,commit,workflow'
title: 'Build started'
build-docker-image:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '22.x'
- name: Build frontend
run: |
cd frontend
npm ci
npm run start:build
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.TOKEN_GH_DEPLOY }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile
platforms: linux/amd64
push: true
tags: |
remnawave/subscription-page:dev
ghcr.io/remnawave/subscription-page:dev
send-telegram-message:
name: Send Telegram message
needs: [build-docker-image]
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v2
- name: Send Telegram message
uses: proDreams/actions-telegram-notifier@main
with:
token: ${{ secrets.TELEGRAM_TOKEN }}
chat_id: ${{ secrets.TELEGRAM_CHAT_ID }}
thread_id: ${{ secrets.TELEGRAM_TOPIC_ID }}
status: success
notify_fields: 'repository,branch,commit,workflow'
title: 'Build finished'
notify-on-error:
runs-on: ubuntu-latest
needs: [build-docker-image]
if: failure()
steps:
- name: Checkout source code
uses: actions/checkout@v2
- name: Send Telegram message
uses: proDreams/actions-telegram-notifier@main
with:
token: ${{ secrets.TELEGRAM_TOKEN }}
chat_id: ${{ secrets.TELEGRAM_CHAT_ID }}
thread_id: ${{ secrets.TELEGRAM_TOPIC_ID }}
status: error
notify_fields: 'repository,branch,commit,workflow'
title: 'Build failed'