ci: Add Gitea Actions workflow for testing and deployment
Some checks failed
CI/CD / test (push) Has been cancelled
CI/CD / build-and-push (push) Has been cancelled

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Jan Novak
2026-01-19 19:50:45 +01:00
parent e048b59ede
commit deaae86f1d

59
.gitea/workflows/ci.yaml Normal file
View File

@@ -0,0 +1,59 @@
name: CI/CD
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
runs-on: linux-amd64
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.25.6'
- name: Download dependencies
working-directory: ./backend
run: go mod download
- name: Build
working-directory: ./backend
run: go build -v ./...
- name: Test
working-directory: ./backend
run: go test -v ./...
build-and-push:
runs-on: linux-amd64
needs: test
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login to Gitea Registry
uses: docker/login-action@v3
with:
registry: gitea.home.hrajfrisbee.cz
username: ${{ github.repository_owner }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push
uses: docker/build-push-action@v5
with:
context: ./backend
file: ./backend/Dockerfile.prod
push: true
tags: |
gitea.home.hrajfrisbee.cz/${{ github.repository }}/backend:latest
gitea.home.hrajfrisbee.cz/${{ github.repository }}/backend:${{ github.sha }}