Files
poimen-memory/.gitea/workflows/build.yaml
T
rock 5cfff3990a
Build and Push Memory Service / Build and Push Image (push) Failing after 9s
ci: simplify workflow - use current directory (repo auto-checked-out)
Previous failure: git clone tried to clone into /workspace which already exists

Fix:
- Remove git clone step
- Forgejo automatically checks out repo into current directory
- Just install git, get commit info, build, and push
- Much simpler and cleaner
2026-09-05 22:41:32 -07:00

54 lines
1.5 KiB
YAML

name: Build and Push Memory Service
on:
push:
branches:
- main
jobs:
build-and-push:
name: Build and Push Image
runs-on: rust
container:
image: docker:27-dind
options: --privileged
steps:
- name: Install git
run: |
apk add --no-cache git
- name: Get commit info
id: info
run: |
SHORT_SHA=$(git -C . rev-parse --short HEAD)
COMMIT_MSG=$(git -C . log -1 --pretty=%B | head -1)
echo "short_sha=${SHORT_SHA}" >> $GITHUB_OUTPUT
echo "commit_msg=${COMMIT_MSG}" >> $GITHUB_OUTPUT
echo "Building: ${SHORT_SHA} - ${COMMIT_MSG}"
- 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"
echo "Image: forgejo.riotpiao.com/rock/poimen-memory:latest"
- name: Cleanup
if: always()
run: |
docker logout forgejo.riotpiao.com || true
echo "✅ Cleanup complete"