Skip to content

Merge pull request #2 from Gickrede-e/aishit/modify-remnawave-for-mul… #1

Merge pull request #2 from Gickrede-e/aishit/modify-remnawave-for-mul…

Merge pull request #2 from Gickrede-e/aishit/modify-remnawave-for-mul… #1

Workflow file for this run

name: Build&Push Release Docker Image
on:
push:
tags:
- '*'
workflow_dispatch:
jobs:
send-tg-msg:
name: Send TG message
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: 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: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '22.x'
- 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@v3
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: |
remnawave/backend:latest
remnawave/backend:${{github.ref_name}}
remnawave/backend:2
ghcr.io/remnawave/backend:latest
ghcr.io/remnawave/backend:${{github.ref_name}}
ghcr.io/remnawave/backend:2
create-release:
needs: [build-docker-image]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '22.x'
- name: NewTag
id: tag
uses: JinoArch/get-latest-tag@latest
- name: Generate changelog
id: changelog
run: |
CHANGELOG=$(npx changelogen --from=${{ steps.tag.outputs.previousTag }} --to=${{ steps.tag.outputs.latestTag }} | sed '/^\[log\]/d')
echo "CHANGELOG<<EOF" >> $GITHUB_ENV
echo "$CHANGELOG" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Create Release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.TOKEN_GH_DEPLOY }}
with:
tag_name: ${{ github.ref_name }}
name: v${{ github.ref_name }}
generate_release_notes: true
append_body: true
make_latest: true
draft: false
prerelease: false
body: |
🌊 Remnawave Backend v${{ github.ref_name }}
<p align="center">
<a href="https://t.me/remnawave" target="_blank" rel="noopener noreferrer">
<img src="https://img.shields.io/badge/Join%20community-Telegram-26A5E4?style=for-the-badge&logo=telegram&logoColor=white" alt="Join community on Telegram" width="220" height="auto">
</a>
</p>
${{ env.CHANGELOG }}
Latest Docker image:
- `remnawave/backend:latest`
- `ghcr.io/remnawave/backend:latest`
Docker images:
- `remnawave/backend:${{github.ref_name}}`
- `ghcr.io/remnawave/backend:${{github.ref_name}}`
send-finish-tg-msg:
name: Send TG message
needs: [build-docker-image, create-release]
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: ${{ job.status }}
notify_fields: 'repository,branch,commit'
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 error notification
uses: proDreams/actions-telegram-notifier@main
with:
token: ${{ secrets.TELEGRAM_TOKEN }}
chat_id: ${{ secrets.TELEGRAM_CHAT_ID }}
thread_id: ${{ secrets.TELEGRAM_TOPIC_ID }}
status: failure
notify_fields: 'repository,branch,commit,workflow'
title: 'Build failed.'