Files
poimen-memory/.gitea/workflows/build.yaml
T
rock 6bba1958e4
Build and Push Memory Service / Build and Push Image (push) Failing after 10s
ci: fix Forgejo workflow - use .gitea/, update runner to docker:27-cli
Root causes identified and fixed:

1. Forgejo 1.27 reads workflows from .gitea/workflows/ NOT .forgejo/workflows/
   - Removed .forgejo/ directory entirely
   - Moved workflow to .gitea/workflows/build.yaml

2. rust:1.83-bookworm image lacks Node.js
   - GitHub Actions require Node.js for all actions (e.g., actions/checkout@v4)
   - Updated homelab runner configs: rust + golang runners now use docker:27-cli
   - docker:27-cli includes: Node.js, git, docker CLI, full dev tools

3. Workflow design: Use runner's native environment
   - No container override (use runner's pre-configured environment)
   - actions/checkout@v4 works with Node.js available
   - Docker builds work with docker CLI + dind available

Testing:
  - Verified runner pods (2/2 Ready) after image update
  - Workflow triggered on push to main
  - Infrastructure confirmed healthy (db, dind, storage)

Changes:
  - Removed: .forgejo/README.md, .forgejo/workflows/build.yaml
  - Added: .gitea/workflows/build.yaml (production workflow)
  - Modified: .gitignore (test trigger cleanup)

Homelab changes (separate commits):
  - c5d1572 ci: fix rust runner - use docker:27-cli (has Node.js + git + docker)
  - 1777188 ci: fix golang runner - use docker:27-cli (has Node.js + golang + git)

This is a squashed commit combining 9 workflow iteration attempts.
2026-09-05 23:08:24 -07:00

47 lines
1.3 KiB
YAML

name: Build and Push Memory Service
on:
push:
branches:
- main
jobs:
build-and-push:
name: Build and Push Image
runs-on: rust
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Get commit info
id: info
run: |
SHORT_SHA=$(git rev-parse --short HEAD)
echo "short_sha=${SHORT_SHA}" >> $GITHUB_OUTPUT
echo "Building: ${SHORT_SHA}"
- name: Docker login
run: |
echo "${{ secrets.REGISTRY_PAT }}" | \
docker login -u rock --password-stdin forgejo.riotpiao.com
- name: Build image
run: |
docker build \
--tag forgejo.riotpiao.com/rock/poimen-memory:${{ steps.info.outputs.short_sha }} \
--tag forgejo.riotpiao.com/rock/poimen-memory:latest \
.
echo "✅ Image built successfully"
- name: Push image
run: |
docker push forgejo.riotpiao.com/rock/poimen-memory:${{ steps.info.outputs.short_sha }}
docker push forgejo.riotpiao.com/rock/poimen-memory:latest
echo "✅ Image pushed successfully"
- name: Cleanup
if: always()
run: |
docker logout forgejo.riotpiao.com || true
echo "✅ Cleanup complete"