turash/.gitea/workflows/ci.yml
Damir Mukimov f3e6e9d44a
Some checks failed
CI/CD Pipeline / backend-lint (push) Failing after 31s
CI/CD Pipeline / backend-build (push) Has been skipped
CI/CD Pipeline / frontend-lint (push) Successful in 1m38s
CI/CD Pipeline / frontend-build (push) Failing after 25s
CI/CD Pipeline / e2e-test (push) Has been skipped
feat: switch to containerd-native CI/CD with buildah
- Replace Docker-based CI/CD with buildah for containerd compatibility
- Remove Docker-in-Docker setup from Gitea runner deployment
- Use buildah/podman which work natively with containerd runtime
- Install buildah and podman in runner container during startup
- Maintain Harbor registry integration and caching capabilities

Benefits:
- Native containerd compatibility (no Docker daemon needed)
- Lighter resource usage (no DinD overhead)
- Better integration with K3s containerd runtime
- Same Harbor registry functionality with cleaner architecture
2025-12-25 16:13:58 +01:00

131 lines
4.1 KiB
YAML

name: CI/CD Pipeline
on:
push:
branches:
- master
paths:
- 'bugulma/**'
- 'k8s/**'
- '.gitea/workflows/**'
pull_request:
branches:
- master
paths:
- 'bugulma/**'
- 'k8s/**'
jobs:
frontend-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '24'
- name: Enable Corepack (for Yarn)
run: corepack enable
- name: Install dependencies
working-directory: bugulma/frontend
run: yarn install --immutable
- name: Lint
working-directory: bugulma/frontend
run: yarn lint
- name: Test
working-directory: bugulma/frontend
run: yarn test --run
frontend-build:
runs-on: ubuntu-latest
needs: frontend-lint
if: gitea.event_name == 'push' && gitea.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v4
- name: Install buildah and podman
run: |
apt-get update
apt-get install -y buildah podman
- name: Log in to Harbor with buildah
run: |
buildah login --username ${{ secrets.DOCKER_USERNAME }} --password ${{ secrets.DOCKER_PASSWORD }} registry.bk.glpx.pro
- name: Build and push frontend with buildah
run: |
buildah build \
--tag registry.bk.glpx.pro/turash/turash-frontend:latest \
--tag registry.bk.glpx.pro/turash/turash-frontend:${{ gitea.sha }} \
--file bugulma/frontend/Dockerfile \
bugulma/frontend
buildah push registry.bk.glpx.pro/turash/turash-frontend:latest
buildah push registry.bk.glpx.pro/turash/turash-frontend:${{ gitea.sha }}
backend-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.25.3'
cache: true
- name: Install dependencies
working-directory: bugulma/backend
run: go mod download
- name: Tidy and verify modules
working-directory: bugulma/backend
run: |
go mod tidy
go mod verify
- name: Vet
working-directory: bugulma/backend
run: go vet ./...
- name: Test
working-directory: bugulma/backend
run: go test -v -race -coverprofile=coverage.out ./...
- name: Coverage
working-directory: bugulma/backend
run: go tool cover -html=coverage.out -o coverage.html
backend-build:
runs-on: ubuntu-latest
needs: backend-lint
if: gitea.event_name == 'push' && gitea.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v4
- name: Install buildah and podman
run: |
apt-get update
apt-get install -y buildah podman
- name: Log in to Harbor with buildah
run: |
buildah login --username ${{ secrets.DOCKER_USERNAME }} --password ${{ secrets.DOCKER_PASSWORD }} registry.bk.glpx.pro
- name: Build and push backend with buildah
run: |
buildah build \
--tag registry.bk.glpx.pro/turash/turash-backend:latest \
--tag registry.bk.glpx.pro/turash/turash-backend:${{ gitea.sha }} \
--file bugulma/backend/Dockerfile \
bugulma/backend
buildah push registry.bk.glpx.pro/turash/turash-backend:latest
buildah push registry.bk.glpx.pro/turash/turash-backend:${{ gitea.sha }}
e2e-test:
runs-on: ubuntu-latest
needs: [frontend-build, backend-build]
if: gitea.event_name == 'push' && gitea.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '24'
- name: Enable Corepack (for Yarn)
run: corepack enable
- name: Install dependencies
working-directory: bugulma/frontend
run: yarn install --immutable
- name: Run E2E tests
working-directory: bugulma/frontend
run: yarn test:e2e --headed=false