This commit is contained in:
usbharu 2025-02-02 14:47:53 +09:00
parent c0d87f1c0c
commit f628c16d0c
Signed by: usbharu
GPG Key ID: 95CBCF7046307B77
2 changed files with 43 additions and 13 deletions

41
.github/workflows/build-and-push.yaml vendored Normal file
View File

@ -0,0 +1,41 @@
name: docker-ci
on:
push:
branches:
- 'main'
jobs:
docker:
runs-on: ubuntu-latest
container:
image: catthehacker/ubuntu:act-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Login to DockerHub
uses: docker/login-action@v3
with:
registry: git.usbharu.dev
username: usbharu
password: ${{ secrets.PUBLIC_REPOSITORY_PACKAGE_WRITE_TOKEN }}
- name: metadata
id: meta
uses: docker/metadata-action@v5
with:
images: git.usbharu.dev/usbharu/misskey-exporter
tags: |
type=raw,value=latest
type=sha,prefix=,suffix=,format=short
- name: build
uses: docker/build-push-action@v5
with:
file: ./Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

15
main.go
View File

@ -102,18 +102,6 @@ var (
})
)
type MetricGroup struct {
Basename string
Help string
Type string
Value []Metric
}
type Metric struct {
Label map[string]string
Value string
}
func main() {
options, err := misskey.NewClientWithOptions(
misskey.WithAPIToken(apiKey),
@ -159,5 +147,6 @@ func main() {
go collectTimeline()
}()
server.ListenAndServe()
logrus.Error(server.ListenAndServe())
}