feat: create Gitea Actions CI/CD workflow

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-08-18 22:53:18 +03:00
parent cca176270c
commit adfffa0f4b
2 changed files with 60 additions and 9 deletions

View File

@@ -0,0 +1,51 @@
on:
push:
branches:
- master
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22'
- name: Go Modules Cache
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Lint & Test
run: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.54.2
export PATH=$(go env GOPATH)/bin:$PATH
golangci-lint run ./...
go test -v -race ./...
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Registry
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and Push Docker Image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: |
latest
${{ github.sha }}