Update release and test workflows

This commit is contained in:
naiba 2023-11-28 23:18:29 +08:00
parent 354bc7c90f
commit 0e91a00076
4 changed files with 9 additions and 5 deletions

View File

@ -7,7 +7,7 @@ on:
workflow_dispatch:
jobs:
on-success:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

View File

@ -9,6 +9,7 @@ on:
- ".github/workflows/test-on-pr.yml"
- ".github/workflows/contributors.yml"
- ".github/workflows/sync.yml"
- ".github/workflows/release.yml"
- "README.md"
- ".goreleaser.yml"

View File

@ -4,7 +4,7 @@
<br>
<small><i>LOGO designed by <a href="https://xio.ng" target="_blank">熊大</a> .</i></small>
<br><br>
<img alt="GitHub release (with filter)" src="https://img.shields.io/github/v/release/naiba/nezha?style=for-the-badge&label=Dashboard">&nbsp;<img src="https://img.shields.io/github/v/release/nezhahq/agent?color=brightgreen&label=Agent&style=for-the-badge&logo=github">&nbsp;<img src="https://img.shields.io/github/actions/workflow/status/nezhahq/agent/agent.yml?label=Agent%20CI&logo=github&style=for-the-badge">&nbsp;<img src="https://img.shields.io/badge/Installer-v0.15.0-brightgreen?style=for-the-badge&logo=linux">
<img alt="GitHub release (with filter)" src="https://img.shields.io/github/v/release/naiba/nezha?style=for-the-badge&logo=github&label=Dashboard">&nbsp;<img src="https://img.shields.io/github/v/release/nezhahq/agent?color=brightgreen&label=Agent&style=for-the-badge&logo=github">&nbsp;<img src="https://img.shields.io/github/actions/workflow/status/nezhahq/agent/agent.yml?label=Agent%20CI&logo=github&style=for-the-badge">&nbsp;<img src="https://img.shields.io/badge/Installer-v0.15.0-brightgreen?style=for-the-badge&logo=linux">
<br>
<br>
<p>:trollface: <b>Nezha Monitoring: Self-hostable, lightweight, servers and websites monitoring and O&M tool.</b></p>

View File

@ -16,6 +16,7 @@ import (
"github.com/nicksnyder/go-i18n/v2/i18n"
"github.com/naiba/nezha/pkg/mygin"
"github.com/naiba/nezha/pkg/utils"
"github.com/naiba/nezha/resource"
"github.com/naiba/nezha/service/singleton"
)
@ -29,9 +30,11 @@ func ServeWeb(port uint) *http.Server {
if err != nil {
panic(err)
}
tmpl, err = tmpl.ParseGlob("resource/template/**/*.html")
if err != nil {
panic(err)
if utils.IsFileExists("resource/template") {
tmpl, err = tmpl.ParseGlob("resource/template/**/*.html")
if err != nil {
panic(err)
}
}
r.SetHTMLTemplate(tmpl)
if singleton.Conf.Debug {