mirror of
https://github.com/remnawave/subscription-page.git
synced 2026-05-13 12:06:39 +00:00
feat: dev build
This commit is contained in:
parent
a6faf21f12
commit
e5e64fac23
1 changed files with 106 additions and 0 deletions
106
.github/workflows/build-and-push-dev.yml
vendored
Normal file
106
.github/workflows/build-and-push-dev.yml
vendored
Normal 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'
|
||||
Loading…
Add table
Add a link
Reference in a new issue