Commit graph

129 commits

Author SHA1 Message Date
8933b4f649
ci: migrate from GitLab CI to Forgejo Actions
- Remove .gitlab-ci.yml (GitLab-specific)
- Add .forgejo/workflows/ci.yml (GitHub Actions-compatible)
- Optimized for self-hosted Forgejo runners
- Parallel test + quality jobs
- Docker build with BuildKit caching
- Automated deployment to Kubernetes
- Uses GitHub Actions ecosystem (actions/cache, docker/build-push-action)
2026-03-05 12:35:14 -06:00
be72ff9f93
ci: set DATABASE_URL globally for test job
- Move MIX_ENV and DATABASE_URL to job-level env vars
- Removes need to set them on individual steps
- Ensures all database operations use correct hostname (postgres)
- Fixes 'connection refused' errors from hardcoded localhost in test.exs
2026-03-05 10:32:03 -06:00
bda0c703d2
ci: install postgresql-client for pg_isready command
- Add postgresql-client to system dependencies
- Fixes 'pg_isready: command not found' error in CI
- Required for database readiness check before tests
2026-03-05 10:20:55 -06:00
21572d8873
fix: use service hostname instead of localhost for PostgreSQL
- Remove port mapping (5432:5432) to avoid port conflicts on runner
- Use 'postgres' hostname instead of 'localhost' to access service
- Service containers in Actions are accessible via their service name
- Fixes 'port is already allocated' error on self-hosted runners
2026-03-05 10:04:56 -06:00
996790bebf
perf: optimize CI caching for faster builds
- Split deps and _build into separate caches for better granularity
- Add Elixir/OTP version to cache keys for version-specific builds
- Include lib/**/*.ex hash in build cache for change detection
- Add apt package caching to skip redundant system dependency installs
- Use version-type: strict in setup-beam for consistent versions
- Improves cache hit rate and reduces build times significantly
2026-03-05 10:03:45 -06:00
56d9878130
ci: add explicit wait for PostgreSQL and database creation step
- Add pg_isready wait loop to ensure PostgreSQL service is fully ready
- Run mix ecto.create explicitly before tests to prevent connection errors
- Fixes 'connection refused' errors when database service is still starting
2026-03-05 10:02:39 -06:00
ee4a7b8040
ci: upgrade to Elixir 1.19.5 and OTP 28.3 to match .tool-versions 2026-03-05 09:32:24 -06:00
88ead53d80
ci: update to ubuntu-22.04 from deprecated ubuntu-20.04
Ubuntu 20.04 is deprecated and has limited support.
Using ubuntu-22.04 for better compatibility and support.
2026-03-05 09:24:17 -06:00
079c47198f
fix: use GitHub URL for erlef/setup-beam action
Forgejo doesn't have this action in its registry, so we need to
use the full GitHub URL to fetch it from GitHub's action registry.
2026-03-05 09:21:28 -06:00
c225078668
ci: add comprehensive quality checks before Docker build
Added test job that must pass before building Docker image:
- Code formatting check (mix format --check-formatted)
- Compilation with warnings as errors
- Credo static analysis (--strict mode)
- Full test suite with PostgreSQL + TimescaleDB

Build job now depends on test job passing (needs: test).

This prevents broken code from being deployed to production.
2026-03-05 09:14:23 -06:00
f1b61513d6
fix: handle concurrent pushes in build workflow
Add git pull --rebase before pushing deployment.yaml update
to handle race conditions when multiple builds run.
2026-03-04 17:33:26 -06:00
044e21a823
fix: downgrade checkout to v4 and add Docker mirror to build.yaml
- Use actions/checkout@v4 to avoid punycode deprecation warning
- Add docker-mirror.mcintire.me configuration for faster builds
2026-03-04 17:30:48 -06:00
afafe3fa09
chore: remove redundant build-deploy.yml workflow
Keep build.yaml which updates k8s/deployment.yaml for FluxCD GitOps.
2026-03-04 17:30:34 -06:00
e29981b307
Revert "feat: migrate deployment to Forgejo Actions from GitLab CI"
This reverts commit 27261f107b.
2026-03-04 17:29:36 -06:00
27261f107b
feat: migrate deployment to Forgejo Actions from GitLab CI
Consolidated build and deployment into Forgejo Actions workflow:
- Added deployment job that runs after successful build
- Uses kubectl to deploy to Kubernetes cluster
- Sets image and deployment timestamp
- Removed GitLab CI configuration

Required setup:
- Add KUBECONFIG secret to Forgejo (base64 encoded kubeconfig file)
- Secret should contain context: towerops/towerops:home-cluster-agent
2026-03-04 17:27:38 -06:00
49d11b601b
fix: downgrade checkout action to v4 to avoid punycode deprecation
The punycode module deprecation warning in Node.js is coming from
actions/checkout@v6. Downgrading to v4 which is more stable and
doesn't use the deprecated punycode module.
2026-03-04 17:16:05 -06:00
0a07d6e09e
Revert "fix: resolve Forgejo CI Docker daemon access issues"
This reverts commit 54280fd733.
2026-03-04 17:11:52 -06:00
54280fd733
fix: resolve Forgejo CI Docker daemon access issues
Fixed two CI/CD issues:

1. Docker daemon not accessible
   - Added explicit dockerd startup step
   - Configured buildx to use docker-container driver
   - Driver creates its own buildkitd instance

2. Node.js punycode deprecation warning
   - Downgraded actions/checkout from v6 to v4
   - v4 is more stable and doesn't use deprecated punycode module

Changes ensure the workflow runs successfully in Forgejo Actions runners
that may not have Docker socket access by default.
2026-03-04 17:09:28 -06:00
f761290ed7
chore(config): add Renovate and build workflows 2026-03-03 16:54:19 -06:00
b7e866e560
Route BuildKit pulls through docker-mirror for caching 2026-02-14 15:50:20 -06:00
24d6a2fd44
Add Docker Hub login to CI for BuildKit rate limit avoidance 2026-02-14 15:49:17 -06:00
4610d86043
Use docker-mirror.mcintire.me as pull-through cache for CI builds 2026-02-14 15:28:32 -06:00
8d00a04187
feat: add FluxCD image automation, fix Preseem duplicate AP crash
Switch deployment pipeline from GitLab Agent kubectl to FluxCD image
automation. CI now only builds and pushes tagged images to Forgejo
registry; FluxCD detects new tags and updates the deployment manifest.

Fix Ecto.MultipleResultsError on /dashboard when a device has multiple
Preseem access point records by using limit(1) instead of Repo.get_by.
2026-02-14 10:30:12 -06:00
ab8f0e472d
fix: use registry cache with mode=max for full build stage caching
Replace inline cache with dedicated buildcache tag that stores all
intermediate builder layers. Unchanged stages like deps and compile
will be pulled from cache instead of rebuilt.
2026-02-13 17:41:55 -06:00
62b1487936
fix: remove container spec, let runner provide Node.js and Docker
Runner v12.6.4 defaults to node:lts image which includes Node.js.
The explicit container block prevented Docker socket access needed
for image builds.
2026-02-13 17:09:20 -06:00
549498b48f
fix: add node container and update actions for Forgejo CI
Add node:22-bookworm container image since ubuntu:latest lacks Node.js
required by JavaScript-based actions. Update checkout to v6 and
build-push-action to v6.
2026-02-13 16:44:53 -06:00
891fb04f5a
change runner for forgejo 2026-02-03 14:06:24 -06:00
7c5493b31f
forejo ci update 2026-02-03 14:04:55 -06:00
6505e958cb
add forgejo ci 2026-02-03 13:55:19 -06:00