Build and Push Memory Service / Build and Push Image (push) Failing after 13s
The rust runner pod is pre-configured with: - Rust 1.83-bookworm base image - Docker CLI + Node.js (for GitHub Actions) - Git + all build tools - TLS-secured docker daemon connection at tcp://localhost:2376 Don't override with a container image. Use the runner's native environment. This is the correct pattern for self-hosted runners.
50 lines
1.4 KiB
YAML
50 lines
1.4 KiB
YAML
name: Build and Push Memory Service
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
build-and-push:
|
|
name: Build and Push Image
|
|
runs-on: rust
|
|
# NO container specified - use runner's native environment
|
|
# The rust runner has: Rust 1.83-bookworm + docker CLI + git
|
|
# Docker daemon available at: tcp://localhost:2376 (TLS)
|
|
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"
|