From adfffa0f4bca4e383ce01b57f717faa485f0847f Mon Sep 17 00:00:00 2001 From: Vladimir Zagainov Date: Tue, 18 Aug 2026 22:53:18 +0300 Subject: [PATCH] feat: create Gitea Actions CI/CD workflow Co-Authored-By: Claude --- .gitea/workflows/deploy.yml | 51 +++++++++++++++++++ ...-18-implement-deployment-infrastructure.md | 18 +++---- 2 files changed, 60 insertions(+), 9 deletions(-) create mode 100644 .gitea/workflows/deploy.yml diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml new file mode 100644 index 0000000..870bbf7 --- /dev/null +++ b/.gitea/workflows/deploy.yml @@ -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 }} diff --git a/docs/plans/2026-08-18-implement-deployment-infrastructure.md b/docs/plans/2026-08-18-implement-deployment-infrastructure.md index 93aebb2..793330b 100644 --- a/docs/plans/2026-08-18-implement-deployment-infrastructure.md +++ b/docs/plans/2026-08-18-implement-deployment-infrastructure.md @@ -66,15 +66,15 @@ - [x] verify docker-compose.yml syntax with `docker-compose config` ### Task 3: Create Gitea Actions CI/CD Workflow -- [ ] create `.gitea/workflows/deploy.yml` file -- [ ] add checkout step (actions/checkout@v3) -- [ ] add setup Go step (actions/setup-go@v4, go-version: '1.22') -- [ ] add Go modules cache step (actions/cache@v3) -- [ ] add lint & test step (golangci-lint, go test -v -race ./...) -- [ ] add Docker Buildx setup step (docker/setup-buildx-action@v2) -- [ ] add Docker login step (docker/login-action@v2) -- [ ] add Docker build & push step (docker/build-push-action@v4, tags: latest and {{.CommitID}}) -- [ ] verify Gitea Actions workflow YAML syntax +- [x] create `.gitea/workflows/deploy.yml` file +- [x] add checkout step (actions/checkout@v3) +- [x] add setup Go step (actions/setup-go@v4, go-version: '1.22') +- [x] add Go modules cache step (actions/cache@v3) +- [x] add lint & test step (golangci-lint, go test -v -race ./...) +- [x] add Docker Buildx setup step (docker/setup-buildx-action@v2) +- [x] add Docker login step (docker/login-action@v2) +- [x] add Docker build & push step (docker/build-push-action@v4, tags: latest and {{.CommitID}}) +- [x] verify Gitea Actions workflow YAML syntax ### Task 4: Verify acceptance criteria - [ ] verify Dockerfile matches multi-stage specification