Compare commits

...

3 Commits

Author SHA1 Message Date
c3ca8a6862 Merge pull request 'Testing actions' (#1) from actions into main
Some checks failed
Publish / Test, build, and push image (push) Failing after 6m11s
Reviewed-on: #1
2026-05-16 20:17:33 +00:00
V
0fdb480394 Update container registry url
Some checks failed
CI / Lint and test (push) Has been cancelled
2026-05-16 21:16:07 +01:00
V
a7c93bedc0 Testing actions
All checks were successful
CI / Lint and test (push) Successful in 10m59s
2026-05-16 21:01:27 +01:00
2 changed files with 90 additions and 0 deletions

34
.gitea/workflows/ci.yml Normal file
View File

@ -0,0 +1,34 @@
name: CI
on:
push:
branches-ignore:
- main
jobs:
lint-test:
name: Lint and test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Check formatting
run: |
files="$(gofmt -l .)"
if [ -n "$files" ]; then
echo "The following files need gofmt:"
echo "$files"
exit 1
fi
- name: Vet
run: go vet ./...
- name: Test
run: go test ./...

View File

@ -0,0 +1,56 @@
name: Publish
on:
push:
branches:
- main
jobs:
build-push:
name: Test, build, and push image
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Check formatting
run: |
files="$(gofmt -l .)"
if [ -n "$files" ]; then
echo "The following files need gofmt:"
echo "$files"
exit 1
fi
- name: Vet
run: go vet ./...
- name: Test
run: go test ./...
- name: Read version
run: |
version="$(tr -d '[:space:]' < VERSION)"
if [ -z "$version" ]; then
echo "VERSION file is empty"
exit 1
fi
echo "VERSION=$version" >> "$GITHUB_ENV"
echo "IMAGE=k3crpi.jumpingcrab.com:5000/sabisan:$version" >> "$GITHUB_ENV"
- name: Log in to registry
run: |
echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login k3crpi.jumpingcrab.com \
--username "${{ secrets.REGISTRY_USERNAME }}" \
--password-stdin
- name: Build image
run: docker build --pull --tag "$IMAGE" .
- name: Push image
run: docker push "$IMAGE"