Port CI to Forgejo Actions
Some checks failed
ci / backend-test (push) Successful in 5m13s
ci / build-2 (push) Successful in 6m28s
ci / build (push) Successful in 5m22s
ci / backend-docker (push) Successful in 0s
ci / build-1 (push) Successful in 6m4s
ci / agent-docker (push) Successful in 0s
ci / frontend-docker (push) Successful in 0s
ci / build-3 (push) Failing after 18m46s
ci / buildimage-docker (push) Failing after 0s
ci / build-4 (push) Has been skipped
ci / chart (push) Failing after 0s

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Jonas Leder 2026-11-18 10:12:11 +01:00
commit 8597104118
2 changed files with 71 additions and 110 deletions

71
.forgejo/workflows/ci.yml Normal file
View file

@ -0,0 +1,71 @@
name: ci
on:
push:
branches: ['**']
tags: ['**']
workflow_dispatch:
jobs:
backend-test:
runs-on: default
env:
GOPROXY: https://goproxy.jonasled.dev,direct
steps:
- uses: https://code.forgejo.org/actions/checkout@v7
- uses: https://code.forgejo.org/actions/setup-go@v7
with:
go-version: '1.27'
cache-dependency-path: backend/go.sum
- run: |
cd backend
go test ./...
backend-docker:
uses: infra/ci-snippets/.forgejo/workflows/docker-build.yml@master
with:
image-suffix: /backend
additional-args: --opt filename=Dockerfile.backend
secrets: inherit
frontend-docker:
uses: infra/ci-snippets/.forgejo/workflows/docker-build.yml@master
with:
image-suffix: /frontend
additional-args: --opt filename=Dockerfile.frontend
secrets: inherit
agent-docker:
uses: infra/ci-snippets/.forgejo/workflows/docker-build.yml@master
with:
image-suffix: /agent
context-dir: agent
additional-args: --opt filename=Dockerfile
secrets: inherit
buildimage-docker:
uses: infra/ci-snippets/.forgejo/workflows/docker-build.yml@master
with:
image-suffix: /buildimage
context-dir: buildimage
additional-args: --opt filename=Dockerfile
secrets: inherit
# helm install aur-builder oci://forgejo.jonasled.dev/<owner>/k8s-aur-builder/charts/aur-builder --version <version>
chart:
needs: [backend-docker, frontend-docker, agent-docker, buildimage-docker]
if: github.ref_type == 'tag' || github.ref_name == github.event.repository.default_branch
uses: infra/ci-snippets/.forgejo/workflows/helm-build.yml@master
with:
chart-path: helm/aur-builder
push: true
lint: false
# Patch is run number plus the last GitLab pipeline (1068) so versions keep growing.
version-from-run-number: true
version-offset: '1068'
pre-package: |
set -eu
IMAGE="$REGISTRY/$(echo "$GITHUB_REPOSITORY" | tr 'A-Z' 'a-z')"
f=helm/aur-builder/values.yaml
sed -i "s|repository: jonasled.dev/jonasled/k8s-aur-builder/|repository: $IMAGE/|; s/^ tag: latest$/ tag: $GITHUB_SHA/" "$f"
secrets: inherit

View file

@ -1,110 +0,0 @@
stages:
- test
- build
- bundle
BackendTests:
stage: test
image: golang:1.27.4-alpine
script:
- apk add --no-cache git
- cd backend
- GOPROXY=https://goproxy.jonasled.dev,direct go test ./...
# FrontendTests:
# stage: test
# image: node:24.15-alpine
# script:
# - corepack enable
# - cd frontend
# - yarn install --immutable
# - yarn test
BackendDocker:
image: jonasled.dev/infra/docker-build:master@sha256:d6f535fcb2817edec221eac33331369863f3409322d5f2d516356e7e7554326b
stage: build
needs: []
script:
- export IMAGE_NAME=$CI_REGISTRY_IMAGE/backend
- export BUILDKIT_ADDITIONAL_ARGS="--opt filename=Dockerfile.backend"
- build-image
- mv image-hash.txt image-hash-backend.txt
- mv image-scan-report.bom.json backend.bom.json
artifacts:
paths:
- image-hash-backend.txt
- backend.bom.json
FrontendDocker:
image: jonasled.dev/infra/docker-build:master@sha256:d6f535fcb2817edec221eac33331369863f3409322d5f2d516356e7e7554326b
stage: build
needs: []
script:
- export IMAGE_NAME=$CI_REGISTRY_IMAGE/frontend
- export BUILDKIT_ADDITIONAL_ARGS="--opt filename=Dockerfile.frontend"
- build-image
- mv image-hash.txt image-hash-frontend.txt
- mv image-scan-report.bom.json frontend.bom.json
artifacts:
paths:
- image-hash-frontend.txt
- frontend.bom.json
AgentDocker:
image: jonasled.dev/infra/docker-build:master@sha256:d6f535fcb2817edec221eac33331369863f3409322d5f2d516356e7e7554326b
stage: build
needs: []
script:
- export IMAGE_NAME=$CI_REGISTRY_IMAGE/agent
- export BUILDKIT_ADDITIONAL_ARGS="--opt filename=Dockerfile"
- cd agent
- build-image
- mv image-hash.txt ../image-hash-agent.txt
- mv image-scan-report.bom.json ../agent.bom.json
artifacts:
paths:
- image-hash-agent.txt
- agent.bom.json
BuildimageDocker:
image: jonasled.dev/infra/docker-build:master@sha256:d6f535fcb2817edec221eac33331369863f3409322d5f2d516356e7e7554326b
stage: build
needs: []
script:
- export IMAGE_NAME=$CI_REGISTRY_IMAGE/buildimage
- export BUILDKIT_ADDITIONAL_ARGS="--opt filename=Dockerfile"
- cd buildimage
- build-image
- mv image-hash.txt ../image-hash-buildimage.txt
- mv image-scan-report.bom.json ../buildimage.bom.json
artifacts:
paths:
- image-hash-buildimage.txt
- buildimage.bom.json
Helm:
# Install: helm install aur-builder oci://$CI_REGISTRY/$CI_PROJECT_PATH/charts/aur-builder --version <version>
stage: bundle
image:
name: alpine/helm:4.3.2
entrypoint: [""]
needs:
- BackendDocker
- FrontendDocker
- AgentDocker
- BuildimageDocker
variables:
CHART_DIR: helm/aur-builder
CHART_REPO: oci://$CI_REGISTRY/$CI_PROJECT_PATH/charts
script:
- helm dependency update "$CHART_DIR"
- 'sed -i "s/^ tag: latest$/ tag: $CI_COMMIT_SHA/" "$CHART_DIR/values.yaml"'
# Patch number is the pipeline IID so versions only grow; major.minor comes from Chart.yaml.
- |
BASE_VERSION=$(sed -n 's/^version: *//p' "$CHART_DIR/Chart.yaml" | cut -d. -f1,2)
- helm package "$CHART_DIR" --version "${BASE_VERSION}.${CI_PIPELINE_IID}" --app-version "$CI_COMMIT_SHA" --destination dist
- helm registry login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY"
- helm push dist/aur-builder-*.tgz "$CHART_REPO"
artifacts:
paths:
- dist/