Add Dockerfile and test/build action.
Fix indentation. Use patched upload-artifact action. Update git URL in module. Divide workflows and give them order, add badges. Apparently workflow_run isn't supported yet... Update build to build container and push to registry. Fix some docker registry things. Use internal IPv4 for registry. Missed a spot. I think this order makes a difference. force HTTP use in login this? Use GITHUB_TOKEN instead. idk man i'm just gonna rebase this to clean the log Use a PAT. Copy files over correctly. blah
This commit is contained in:
parent
dfc8ff001e
commit
10259ca924
29
.gitea/workflows/build.yaml
Normal file
29
.gitea/workflows/build.yaml
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
name: build
|
||||||
|
run-name: ${{ gitea.actor }} is building.
|
||||||
|
on: [push]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: docker buildx setup
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
- name: login to container registry
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: git.hl.srp.life
|
||||||
|
username: ${{ gitea.repository_owner }}
|
||||||
|
password: ${{ secrets.ACTIONS_KEY }}
|
||||||
|
- name: checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: build and push to registry
|
||||||
|
uses: docker/build-push-action@v6
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: ./Dockerfile
|
||||||
|
platforms: |
|
||||||
|
linux/amd64
|
||||||
|
linux/arm64
|
||||||
|
push: true
|
||||||
|
tags: |
|
||||||
|
${{ gitea.repository }}:dev
|
22
.gitea/workflows/test.yaml
Normal file
22
.gitea/workflows/test.yaml
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
name: test
|
||||||
|
run-name: ${{ gitea.actor }} is testing.
|
||||||
|
on: [push]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: setup go 1.23.1 and fetch deps
|
||||||
|
uses: actions/setup-go@v5
|
||||||
|
with:
|
||||||
|
go-version: '1.23.1'
|
||||||
|
cache-dependency-path: go.sum
|
||||||
|
- name: do the actual test thing
|
||||||
|
run: go test -json > testresults-1.23.1.json
|
||||||
|
- name: upload test results
|
||||||
|
uses: christopherhx/gitea-upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: go-results-1.23.1
|
||||||
|
path: testresults-1.23.1.json
|
10
Dockerfile
Normal file
10
Dockerfile
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
FROM golang:1.23
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY . ./
|
||||||
|
RUN go mod download
|
||||||
|
|
||||||
|
RUN CGO_ENABLED=0 GOOS=linux go build -o /bingo
|
||||||
|
|
||||||
|
EXPOSE 3005
|
||||||
|
CMD [ "/bingo", "run" ]
|
@ -1,5 +1,6 @@
|
|||||||
# bingo
|
# bingo
|
||||||
A lightweight {paste,file}bin alternative written in Golang.
|
A lightweight {paste,file}bin alternative written in Golang.
|
||||||
|
![test status](https://git.hl.srp.life/srp/bingo/actions/workflows/test.yaml/badge.svg) ![build status](https://git.hl.srp.life/srp/bingo/actions/workflows/build.yaml/badge.svg)
|
||||||
|
|
||||||
Overall goal is to create a service that works well as a single-user self-hosted instance, which can trivially upload files/text.
|
Overall goal is to create a service that works well as a single-user self-hosted instance, which can trivially upload files/text.
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"git.sr.ht/~seraphimrp/bingo/routes"
|
"git.hl.srp.life/srp/bingo/routes"
|
||||||
"github.com/briandowns/spinner"
|
"github.com/briandowns/spinner"
|
||||||
"github.com/dgraph-io/badger/v4"
|
"github.com/dgraph-io/badger/v4"
|
||||||
"github.com/gofiber/fiber/v2"
|
"github.com/gofiber/fiber/v2"
|
||||||
|
2
go.mod
2
go.mod
@ -1,4 +1,4 @@
|
|||||||
module git.sr.ht/~seraphimrp/bingo
|
module git.hl.srp.life/srp/bingo
|
||||||
|
|
||||||
go 1.23.1
|
go 1.23.1
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user