feat(onboarding): Update onboarding UI and enhance CI/CD workflows [bump-minor]

This commit is contained in:
Félix MARQUET
2025-06-24 14:16:54 +02:00
parent 288192bd29
commit c2a86cb9d4
5 changed files with 99 additions and 51 deletions

View File

@@ -95,7 +95,7 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4
- name: Configurer Docker
- name: Configurer Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login Docker Hub
@@ -104,7 +104,7 @@ jobs:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Télécharger l'exécutable binaire
- name: Télécharger le binaire
uses: actions/download-artifact@v4
with:
name: github-ntfy

View File

@@ -29,18 +29,44 @@ jobs:
MINOR=$(echo $VERSION | cut -d. -f2)
PATCH=$(echo $VERSION | cut -d. -f3)
# Incrémenter le patch
PATCH=$((PATCH + 1))
# Récupérer le dernier message de commit
COMMIT_MSG=$(git log -1 --pretty=%B)
# Déterminer quel niveau de version doit être incrémenté
if echo "$COMMIT_MSG" | grep -q "\[bump-major\]"; then
echo "Incrémentation de la version majeure détectée dans le message de commit"
MAJOR=$((MAJOR + 1))
MINOR=0
PATCH=0
elif echo "$COMMIT_MSG" | grep -q "\[bump-minor\]"; then
echo "Incrémentation de la version mineure détectée dans le message de commit"
MINOR=$((MINOR + 1))
PATCH=0
elif echo "$COMMIT_MSG" | grep -q "\[version="; then
# Format personnalisé: [version=X.Y.Z]
CUSTOM_VERSION=$(echo "$COMMIT_MSG" | grep -o '\[version=[0-9]*\.[0-9]*\.[0-9]*\]' | sed 's/\[version=\(.*\)\]/\1/')
if [ ! -z "$CUSTOM_VERSION" ]; then
echo "Version personnalisée détectée: $CUSTOM_VERSION"
MAJOR=$(echo $CUSTOM_VERSION | cut -d. -f1)
MINOR=$(echo $CUSTOM_VERSION | cut -d. -f2)
PATCH=$(echo $CUSTOM_VERSION | cut -d. -f3)
else
# Incrémentation de patch par défaut
PATCH=$((PATCH + 1))
fi
else
# Incrémentation de patch par défaut
PATCH=$((PATCH + 1))
fi
# Nouvelle version
NEW_VERSION="v$MAJOR.$MINOR.$PATCH"
echo "Nouvelle version: $NEW_VERSION"
echo "tag=$NEW_VERSION" >> $GITHUB_OUTPUT
build-binaries:
build-binary:
needs: version
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
@@ -109,14 +135,18 @@ jobs:
pnpm install
pnpm generate
- name: Vérifier le contenu du répertoire output
run: |
ls -la web/.output/public || echo "Le répertoire .output n'existe pas!"
- name: Upload frontend comme artifact
uses: actions/upload-artifact@v4
with:
name: nuxt-frontend
path: web/.output
path: web/.output/public
docker-build-push:
needs: [version, build-binaries, build-frontend]
needs: [version, build-binary, build-frontend]
runs-on: ubuntu-latest
steps:
- name: Checkout code
@@ -141,19 +171,20 @@ jobs:
uses: actions/download-artifact@v4
with:
name: nuxt-frontend
path: web/.output
path: web/.output/public
- name: Préparer les fichiers pour Docker
run: |
chmod +x binaries/github-ntfy
mkdir -p docker-build
cp binaries/github-ntfy docker-build/
cp -r web/.output docker-build/web
mkdir -p docker-build/web-output/public
cp -r web/.output/public/* docker-build/web-output/public/
cp nginx.conf docker-build/
cp entrypoint.sh docker-build/
cp Dockerfile docker-build/
chmod +x docker-build/entrypoint.sh
# Construire et pousser l'image multi-architecture
- name: Construire et pousser l'image Docker
uses: docker/build-push-action@v6
with:
@@ -162,10 +193,10 @@ jobs:
tags: |
breizhhardware/github-ntfy:latest
breizhhardware/github-ntfy:${{ needs.version.outputs.version }}
file: Dockerfile
file: docker-build/Dockerfile
create-release:
needs: [version, build-binaries, build-frontend]
needs: [version, build-binary, build-frontend]
runs-on: ubuntu-latest
steps:
- name: Checkout code
@@ -181,13 +212,13 @@ jobs:
uses: actions/download-artifact@v4
with:
name: nuxt-frontend
path: web/.output
path: web/.output/public
- name: Préparer les fichiers pour la release
run: |
mkdir -p release-artifacts
cp binaries/github-ntfy release-artifacts/
tar -czf release-artifacts/frontend.tar.gz -C web/.output .
tar -czf release-artifacts/frontend.tar.gz -C web/.output/public .
- name: Créer une release GitHub
uses: softprops/action-gh-release@v1

View File

@@ -1,15 +1,16 @@
name: Dependabot Build Check
name: Dependabot Build
on:
pull_request:
branches: [dev]
permissions:
contents: read
pull-requests: read
branches: [ 'main', 'dev' ]
paths:
- '**/Cargo.toml'
- '**/Cargo.lock'
- 'web/package.json'
- 'web/pnpm-lock.yaml'
jobs:
build:
build-binary:
if: ${{ startsWith(github.ref, 'refs/heads/dependabot/') || github.actor == 'dependabot[bot]' }}
runs-on: ubuntu-latest
steps:
@@ -28,18 +29,40 @@ jobs:
- name: Créer Cross.toml pour spécifier OpenSSL vendored
run: |
cat > Cross.toml << 'EOL'
[target.x86_64-unknown-linux-musl]
image = "ghcr.io/cross-rs/x86_64-unknown-linux-musl:main"
cat > Cross.toml << 'EOF'
[build.env]
passthrough = [
"RUST_BACKTRACE",
"RUSTFLAGS",
"OPENSSL_STATIC",
"OPENSSL_NO_VENDOR"
]
EOL
EOF
- name: Build Backend (Rust)
run: cross build --release --target x86_64-unknown-linux-musl
- name: Construire avec cross et OpenSSL vendored
env:
OPENSSL_STATIC: 1
RUSTFLAGS: "-C target-feature=+crt-static"
OPENSSL_NO_VENDOR: 0
run: |
cross build --release --target x86_64-unknown-linux-musl --features vendored-openssl
- name: Préparer le binaire
run: |
mkdir -p release
cp target/x86_64-unknown-linux-musl/release/github-ntfy release/github-ntfy
- name: Upload binaire comme artifact
uses: actions/upload-artifact@v4
with:
name: github-ntfy-dependabot
path: release/github-ntfy
build-frontend:
if: ${{ github.actor == 'dependabot[bot]' || startsWith(github.ref, 'refs/heads/dependabot/') }}
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
@@ -56,10 +79,14 @@ jobs:
run: |
cd web
pnpm install
pnpm build
pnpm generate
- name: Afficher des informations de débogage
- name: Vérifier le contenu du répertoire output
run: |
echo "Acteur: ${{ github.actor }}"
echo "Référence de la branche: ${{ github.head_ref }}"
echo "Event name: ${{ github.event_name }}"
ls -la web/.output/public || echo "Le répertoire .output n'existe pas!"
- name: Upload frontend comme artifact
uses: actions/upload-artifact@v4
with:
name: nuxt-frontend-dependabot
path: web/.output/public

View File

@@ -1,6 +1,6 @@
<h1 align="center">Welcome to ntfy_alerts 👋</h1>
<p>
<img alt="Version" src="https://img.shields.io/badge/version-2.0-blue.svg?cacheSeconds=2592000" />
<img alt="Version" src="https://img.shields.io/badge/version-2.1-blue.svg?cacheSeconds=2592000" />
<a href="#" target="_blank">
<img alt="License: GPL--3" src="https://img.shields.io/badge/License-GPL--3-yellow.svg" />
</a>
@@ -22,18 +22,6 @@ services:
github-ntfy:
image: breizhhardware/github-ntfy:latest
container_name: github-ntfy
environment:
- USERNAME=username # Required
- PASSWORD=password # Required
- NTFY_URL=ntfy_url # Required if ntfy is used
- GHNTFY_TIMEOUT=timeout # Default is 3600 (1 hour)
- GHNTFY_TOKEN= # Default is empty (Github token)
- DOCKER_USERNAME= # Default is empty (Docker Hub username)
- DOCKER_PASSWORD= # Default is empty (Docker Hub password)
- GOTIFY_URL=gotify_url # Required if gotify is used
- GOTIFY_TOKEN= # Required if gotify is used
- DISCORD_WEBHOOK_URL= # Required if discord is used
- SLACK_WEBHOOK_URL= # Required if Slack is used
volumes:
- /path/to/data:/data
ports:
@@ -72,9 +60,9 @@ The GitHub token (GHNTFY_TOKEN) needs to have the following permissions: repo, r
## TODO
- [ ] Add support for multi achitecture Docker images
- [ ] Rework web interface
- [x] Rework web interface
- [ ] Add support for more notification services (Telegram, Matrix, etc.)
- [ ] Add web oneboarding instead of using environment variables
- [x] Add web oneboarding instead of using environment variables
## Author
👤 BreizhHardware

View File

@@ -1,7 +1,9 @@
<template>
<header class="py-6 bg-emerald-950 shadow-lg rounded-b-lg mb-4">
<div class="container mx-auto px-4 flex justify-between items-center">
<h1 class="text-4xl font-bold tracking-wide text-white">Github Ntfy</h1>
<NuxtLink to="/" class="text-white hover:text-gray-200 transition-colors duration-200">
<h1 class="text-4xl font-bold tracking-wide">Github Ntfy</h1>
</NuxtLink>
<div v-if="auth.isAuthenticated" class="flex space-x-3">
<UButton