Build and Push Memory Service / Build and Push Image (push) Failing after 12s
Updated in homelab: forgejo-runner-rust now uses docker:27-cli image which includes Node.js + git + docker + full dev tools. This allows actions/checkout@v4 and other GitHub Actions to work. Workflow simplified: - No container override (use runner's native environment) - Uses actions/checkout@v4 (requires Node.js) - Builds and pushes to registry Test commit to verify new runner configuration works.
47 lines
1.3 KiB
YAML
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"
|